/*
 * 新UI版 AI指数 成績表（/seiseki/。2026-10-29 No.006-②）。共通UI（kyouma-ui.css）の黒背景・トークンを使う。
 * 期間タブ・集計の数字（kui-seiseki-tabs・kui-seiseki-stat）は TOP の成績表と同じクラスで同じ見た目。
 * はんこ・花丸・円グラフは既存の成績表の形を残し、黒背景で読める色にした。PC（760px〜）は表、スマホは1レース1カード。
 */
.ss-page .kui-wrap { padding-bottom: 8px; }
.ss { display: grid; gap: 14px; }
.ss-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ss-summary h1 { margin: 0; color: #fff; font-size: 22px; line-height: 1.35; }
.ss-tabs { margin-top: 12px; }
.ss-panel { min-height: 120px; }
.ss-state { margin: 16px 0; color: var(--kui-muted); font-size: 15px; text-align: center; }
.ss-state-sub { display: block; margin-top: 4px; font-size: 12px; }
.ss-state.ss-error { padding: 10px 12px; border: 1px solid #7a3f3a; border-radius: 10px; background: #2a1715; color: #f0a59c; }
.ss-stats { margin-top: 2px; }

/* 着順の内訳（1着・2着・3着・着外） */
.ss-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 10px 0 0; }
.ss-count { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 8px 2px 7px; border: 1px solid #303842; border-radius: 10px; background: #171c22; }
.ss-count dt { color: #d5dbe3; font-size: 12px; font-weight: 700; }
.ss-count dd { margin: 0; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ss-count dd b { font-size: 21px; font-weight: 800; }
.ss-count dd small { margin-left: 1px; color: var(--kui-muted); font-size: 11px; }
.ss-count.is-first dt::before { content: "🥇"; margin-right: 2px; }
.ss-count.is-second dt::before { content: "🥈"; margin-right: 2px; }
.ss-count.is-third dt::before { content: "🥉"; margin-right: 2px; }

/* 円グラフ（値に応じて弧が伸びる。1着率＝緑、3着内率＝金） */
.ss-rates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.ss-rate { display: flex; align-items: center; justify-content: center; padding: 14px 6px; border: 1px solid #303842; border-radius: 12px; background: #171c22; }
.ss-ring { --size: min(36vw, 150px); --w: 12px; position: relative; width: var(--size); height: var(--size); border-radius: 50%; }
.ss-rate.is-win .ss-ring { background: conic-gradient(from 0deg, #2fa86a, #63dba0 calc(var(--p) * 1%), #2b323b 0); }
.ss-rate.is-top3 .ss-ring { background: conic-gradient(from 0deg, #a8823a, #e2c27f calc(var(--p) * 1%), #2b323b 0); }
.ss-ring-in { position: absolute; inset: var(--w); display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: #11151a; }
.ss-ring-label { color: #d5dbe3; font-size: 13px; font-weight: 700; }
.ss-ring-value { line-height: 1.1; font-variant-numeric: tabular-nums; }
.ss-ring-value b { font-size: clamp(24px, 7.5vw, 34px); font-weight: 800; }
.ss-ring-value small { margin-left: 2px; font-size: 14px; font-weight: 700; }
.ss-rate.is-win .ss-ring-value { color: var(--kui-ok-hover); }
.ss-rate.is-top3 .ss-ring-value { color: #e9cf91; }

/* 先生からひとこと（はんこ・花丸） */
.ss-teacher-wrap { margin-top: 12px; }
.ss-teacher { container-type: inline-size; position: relative; padding: 14px 14px 12px; border: 1px solid #303842; border-radius: 12px; background: #171c22; overflow: hidden; }
.ss-teacher-label { margin: 0; padding-left: 10px; border-left: 3px solid #e5483b; color: #fff; font-size: 15px; font-weight: 700; line-height: 1.4; }
.ss-teacher-fixed { display: block; margin-top: 1px; color: var(--kui-muted); font-size: 12px; font-weight: 400; }
.ss-stamp-row { display: flex; align-items: center; justify-content: center; margin: 18px 0 14px; padding-right: 30px; }
.ss-stamp { position: relative; margin: 0; }
.ss-stamp span {
  display: inline-block; padding: 6px 16px 9px; border: 3px double #e5483b; border-radius: 10px; color: #ff6b5e; font-weight: 800; line-height: 1.25; letter-spacing: .06em; white-space: nowrap;
  font-size: clamp(16px, 5vw, 28px); font-size: clamp(14px, calc((100cqi - 80px) / (var(--n, 11) + .5)), 30px);
  transform: rotate(-4deg); background: rgba(229, 72, 59, .08); box-shadow: 0 0 14px rgba(229, 72, 59, .18);
}
.ss-teacher.is-level-1 .ss-stamp span { transform: rotate(-2deg); color: #f0a59c; border-color: #b8564d; }
.ss-hanamaru { position: absolute; right: -26px; top: -24px; display: block; width: 50px; height: 50px; color: #ff6b5e; transform: rotate(10deg); pointer-events: none; }
.ss-hanamaru svg { width: 100%; height: 100%; }
.ss-teacher-basis { padding: 9px 12px; border-radius: 8px; background: #221817; text-align: center; }
.ss-basis-title { margin: 0; color: #f3f5f7; font-size: 13px; font-weight: 700; }
.ss-basis-detail { margin: 2px 0 0; color: var(--kui-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 注記・条件 */
.ss-notes:empty { display: none; }
.ss-src-note, .ss-nodata, .ss-warn { margin: 10px 0 0; color: var(--kui-muted); font-size: 12px; line-height: 1.6; text-align: center; }
.ss-warn { padding: 8px 10px; border: 1px solid #6b5a33; border-radius: 8px; background: #221d12; color: var(--kui-warn); text-align: left; }
.ss-src { display: inline-block; padding: 0 6px; border: 1px solid #4a5563; border-radius: 4px; color: #c9d1dd; font-size: 10.5px; font-weight: 700; line-height: 1.7; white-space: nowrap; vertical-align: middle; }
.ss-rules { margin-top: 12px; border: 1px solid #303842; border-radius: 10px; background: #11151a; }
.ss-rules summary { min-height: 44px; display: flex; align-items: center; padding: 0 14px; color: #d5dbe3; font-size: 14px; font-weight: 700; cursor: pointer; }
.ss-rules ul { margin: 0; padding: 0 16px 12px 30px; color: #c9d1dd; font-size: 13px; line-height: 1.7; }
.ss-rules b { color: #fff; }

/* 一覧 */
.ss-list[hidden] { display: none; }
.ss-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.ss-list-head h2 { margin: 0; color: #fff; font-size: 18px; }
.ss-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-select select { min-height: 44px; max-width: 100%; padding: 0 30px 0 12px; border: 1px solid #4a5662; border-radius: 9px; background: #212831; color: #f7f8fa; font-size: 14px; }
.ss-venue { display: inline-block; padding: 1px 7px; border-radius: 5px; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap; background: #4a5563; }
.ss-venue.is-kochi { background: #b8402c; }
.ss-venue.is-nagoya { background: #34558b; }
.ss-venue.is-kasamatsu { background: #4f6b4a; }
.ss-venue.is-saga { background: #8a6a33; }
.ss-venue.is-kanazawa { background: #6b4a7a; }
.ss-venue.is-monbetsu { background: #2f6f78; }
.ss-venue.is-oi { background: #55555f; }
.ss-venue.is-morioka { background: #8b3a52; }
.ss-venue.is-mizusawa { background: #4a6a8a; }
.ss-venue.is-urawa { background: #a0522d; }
.ss-venue.is-funabashi { background: #2e5e4e; }
.ss-venue.is-kawasaki { background: #7a4b2a; }
.ss-venue.is-sonoda { background: #9c3f6a; }
.ss-venue.is-himeji { background: #5b5e8c; }
.ss-umaban { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border: 1px solid #5a6573; border-radius: 6px; color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ss-horse, .ss-item-horse { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ss-name { color: #fff; font-weight: 700; overflow-wrap: anywhere; }
.ss-index { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.ss-res { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border: 1px solid #4a5563; border-radius: 999px; color: #e9edf2; font-size: 13px; font-weight: 700; white-space: nowrap; }
.ss-res.is-top { border-color: #6d5a2e; background: #241f13; color: #f3dfaa; }
.ss-res.is-1 { border-color: var(--kui-ok-line); background: var(--kui-ok-soft); color: #fff; }
.ss-res.is-stop { color: #f0a59c; }

/* スマホ：カード（1レース1枚・カード全体がレース詳細へのリンク） */
.ss-table-wrap { display: none; }
.ss-cards { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ss-item-link { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid #303842; border-radius: 12px; background: #171c22; color: var(--kui-text); text-decoration: none; }
.ss-item.is-top .ss-item-link { border-color: #4b4430; }
.ss-item-link:hover { border-color: var(--kui-accent-line); }
.ss-item-race { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; color: #d5dbe3; font-size: 13px; }
.ss-item-r { color: #fff; }
.ss-item-name { flex: 1 1 100%; color: #e9edf2; font-size: 14px; overflow-wrap: anywhere; }
.ss-item-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ss-item-index { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--kui-muted); font-size: 12px; }
.ss-item-index .ss-index { font-size: 16px; }
.ss-item-go { margin-left: auto; color: var(--kui-accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.ss-empty { margin: 12px 0 0; color: var(--kui-muted); text-align: center; }
.ss-shown { margin: 12px 0 0; color: var(--kui-muted); font-size: 12px; text-align: center; }
.ss-more-wrap { margin: 10px 0 0; text-align: center; }
.ss-more { min-width: 200px; min-height: 44px; }
.ss-more[hidden] { display: none; }

/* PC：表（行のレース名がレース詳細へのリンク） */
@media (min-width: 760px) {
  .ss-summary h1 { font-size: 24px; }
  .ss-rates { gap: 12px; }
  .ss-ring { --size: 168px; --w: 14px; }
  .ss-ring-value b { font-size: 34px; }
  .ss-hanamaru { width: 56px; height: 56px; right: -30px; top: -28px; }
  .ss-cards { display: none; }
  .ss-table-wrap { display: block; overflow: hidden; border: 1px solid #303842; border-radius: 12px; background: #11151a; }
  .ss-table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .ss-table th { padding: 10px 8px; border-bottom: 1px solid #3c444f; background: #1b2129; color: #d5dbe3; font-size: 12px; text-align: left; white-space: nowrap; }
  .ss-table td { padding: 8px; border-bottom: 1px solid #262d36; color: #e9edf2; vertical-align: middle; }
  .ss-table tr:last-child td { border-bottom: 0; }
  .ss-table tr.is-top td { background: #15181d; }
  .ss-table .num { text-align: right; font-variant-numeric: tabular-nums; }
  .ss-table .res { text-align: center; }
  .ss-date { white-space: nowrap; color: #d5dbe3; }
  .ss-date .ss-src { display: table; margin-top: 3px; }
  .ss-race-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: #fff; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
  .ss-race-link:hover { color: var(--kui-accent-hover); }
  .ss-go { color: var(--kui-accent); }
}
@media (min-width: 1024px) {
  .ss-teacher-wrap { margin-top: 14px; }
}
