/*
 * top.css — トップページ専用（見本: docs/mockup/top.html）
 *
 * 見た目は見本を正とし、値（色・余白・角丸・文字サイズ）は見本の CSS をそのまま写している。
 * サイト共通の CSS（grid.css の .row / style.css の .result 等）と衝突しないよう、見本のクラス名には tp- を付けた。
 * ress.min.css（全要素の margin / padding を 0）と grid.css（見出し・段落・入力欄の既定値）が効いているので、
 * 見本がブラウザ標準に頼っている箇所は「ブラウザ標準に戻す」指定を明示している（見本との差を出さないため）。
 * 共通のヘッダ・フッタ（include）は、トップでだけ見本の見た目に合わせる指定を末尾に置いた。
 */

body.top-page {
    --paper: #F3F5F7; --panel: #FFFFFF; --ink: #111B2E; --ink-2: #4A5568; --line: #DDE3EA;
    --felt: #1E6B57; --felt-deep: #154C3E; --chip: #C8373E; --gold: #D9A441; --gold-deep: #B4841F;
    --safe: #2E8B57; --warn: #D9A441; --danger: #C8373E;
    --r: 10px; --maxw: 1120px;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    font-feature-settings: "palt";
}
body.top-page a { color: inherit; text-decoration: none; }
body.top-page a:hover { color: inherit; }
body.top-page img { max-width: 100%; }
body.top-page :focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
body.top-page main { margin: 0; }

/* grid.css の見出し・段落・リスト・入力欄の既定値（要素セレクタ・詳細度 0,0,1）を、見本が前提にしているブラウザ標準へ戻す。
   詳細度は body.top-page :where(...) で 0,1,1 にそろえる: grid.css には勝ち、同じ詳細度の見本由来の指定
   （.tp-hero h1 など、このファイルで後に書いたもの）には負ける */
body.top-page :where(h1, h2, h3, h4) { font-weight: bold; letter-spacing: normal; line-height: inherit; }
body.top-page :where(main li, main label) { margin: 0; }
body.top-page :where(main) input[type="number"] {
    height: auto; padding: 1px 2px; margin: 0; border: 0; border-radius: 0; background: transparent;
    -webkit-appearance: auto; appearance: auto; box-shadow: none;
}
body.top-page :where(main) input[type="number"]:focus { border: 0; }
/* スライダーはブラウザ標準の文字設定（ress の font: inherit を打ち消す） */
body.top-page :where(main) input[type="range"] { margin: 0; padding: 0; font: 13.3333px Arial; line-height: normal; }

.tp-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

/* 広告帯（ヘッダ下）: 見本のグレー帯。本番は実バナーが入る */
.tp-adbar { background: #E9EDF1; text-align: center; padding: 10px; color: var(--ink-2); font-size: 13px; }
/* バナーの読み込み前から縦横比で高さを確保して、読み込み時にページがずれない（CLS）ようにする。
   ヘッダ下は affstrack 956×40（js/ads-data.js の header プール） */
.tp-adbar .ad-rotator { margin: 0 auto; max-width: 956px; aspect-ratio: 956 / 40; }
.tp-adbar .ad-rotator a, .tp-ad .ad-rotator a { display: block; }
.tp-adbar .ad-rotator img, .tp-ad .ad-rotator img { display: block; width: 100%; height: auto; margin: 0 auto; }

/* ---- hero ---- */
.tp-hero { background: var(--ink); color: #fff; padding: 56px 0 64px; position: relative; overflow: hidden; }
.tp-hero .tp-wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.tp-hero h1 { font-size: clamp(32px, 4.2vw, 50px); line-height: 1.2; margin: 0 0 16px; font-weight: 900; letter-spacing: -.01em; color: #fff; }
.tp-hero p.tp-lead { font-size: 17px; color: #C9D2E0; margin: 0 0 28px; max-width: 34em; }
.tp-mini { background: #fff; color: var(--ink); border-radius: 14px; padding: 22px 22px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.tp-mini .tp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tp-mini label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.tp-mini .tp-in { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fff; }
body.top-page .tp-mini .tp-in input { border: 0; width: 100%; font: inherit; font-size: 20px; font-weight: 700; text-align: right; outline: 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.tp-mini .tp-in span { color: var(--ink-2); font-size: 14px; margin-left: 6px; }
body.top-page .tp-mini input[type=range] { width: 100%; accent-color: var(--felt); margin: 8px 0 0; }
.tp-verdict { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; font-size: 15px; color: var(--ink-2); }
.tp-verdict strong { display: block; font-size: 26px; line-height: 1.25; color: var(--ink); font-weight: 900; margin-bottom: 2px; }
.tp-verdict strong em, .tp-verdict .tp-em { font-style: normal; color: var(--chip); font-weight: 700; }
body.top-page .tp-verdict .tp-go { display: inline-block; margin-top: 10px; font-weight: 700; color: var(--felt); border-bottom: 2px solid currentColor; }
/* ladder（見本の DOM/CSS をそのまま） */
.tp-ladder { display: flex; align-items: flex-end; gap: 6px; height: 280px; padding: 0 0 26px; position: relative; }
.tp-ladder .tp-bar { flex: 1; background: linear-gradient(180deg, #5FB39B, #2E8B72); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; transition: height .35s cubic-bezier(.2,.8,.2,1); }
.tp-ladder .tp-bar.tp-over { background: linear-gradient(180deg, #F08A90, var(--chip)); }
.tp-ladder .tp-bar i { position: absolute; bottom: -24px; left: 0; right: 0; text-align: center; font-size: 12px; color: #93A1B5; font-style: normal; }
.tp-ladder .tp-bar b { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 12px; white-space: nowrap; color: #fff; font-weight: 500; opacity: 0; }
.tp-ladder .tp-bar:hover b, .tp-ladder .tp-bar.tp-first b, .tp-ladder .tp-bar.tp-last b { opacity: 1; }
.tp-ladder .tp-cap { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--gold); font-size: 12px; color: var(--gold); padding-top: 4px; pointer-events: none; }
.tp-hero .tp-caption { color: #93A1B5; font-size: 13px; margin: 8px 0 0; }
.tp-ctas { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
body.top-page .tp-btn { display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 16px; border: 2px solid transparent; }
body.top-page .tp-btn.tp-gold { background: var(--gold); color: var(--ink); }
body.top-page .tp-btn.tp-gold:hover { background: #E6B858; }
body.top-page .tp-btn.tp-ghost { border-color: #5A6A85; color: #fff; }
body.top-page .tp-btn.tp-ghost:hover { border-color: #fff; }
body.top-page .tp-btn.tp-ink { background: var(--ink); color: #fff; }
body.top-page .tp-btn.tp-felt { background: var(--felt); color: #fff; }

/* ---- arena band ---- */
.tp-arena { background: var(--felt-deep); color: #fff; padding: 52px 0; }
.tp-arena .tp-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.tp-arena h2 { font-size: 30px; margin: 0 0 10px; font-weight: 900; color: #fff; }
.tp-arena p { color: #CFE3DB; margin: 0 0 18px; font-size: 16px; }
.tp-arena ul { margin: 0 0 22px; padding: 0; list-style: none; color: #fff; }
.tp-arena li { padding: 8px 0; border-top: 1px solid rgba(255,255,255,.14); font-size: 15px; }
.tp-arena li:last-child { border-bottom: 1px solid rgba(255,255,255,.14); }
.tp-race { background: var(--felt); border-radius: 14px; padding: 18px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
/* 見本の #BFE0D3 は背景 #1E6B57 に対して 4.49:1 で基準 4.5:1 に届かないため、わずかに明るくした */
.tp-race .tp-hdr { display: flex; justify-content: space-between; font-size: 13px; color: #C2E2D5; margin-bottom: 12px; }
.tp-lane { display: grid; grid-template-columns: 110px 1fr 70px; align-items: center; gap: 10px; margin: 10px 0; font-size: 14px; }
.tp-lane .tp-name { font-weight: 700; }
.tp-lane .tp-track { height: 16px; background: rgba(0,0,0,.28); border-radius: 999px; overflow: hidden; position: relative; }
.tp-lane .tp-fill { height: 100%; border-radius: 999px; background: var(--gold); width: 50%; animation: tp-run 6s ease-in-out infinite; }
.tp-lane:nth-child(3) .tp-fill { animation-delay: -1.5s; background: #7DD3B5; }
.tp-lane:nth-child(4) .tp-fill { animation-delay: -3s; background: #F08A90; }
.tp-lane:nth-child(5) .tp-fill { animation-delay: -4.5s; background: #9FB6FF; }
.tp-lane .tp-val { text-align: right; font-variant-numeric: tabular-nums; color: #E7F3EE; }
/* 見本の #F7A8AD は背景に対して 3.38:1。同じ色相のまま 4.5:1 以上になるまで明るくした */
.tp-lane.tp-bust .tp-val { color: #FFD6D8; }
@keyframes tp-run { 0% { width: 50%; } 25% { width: 64%; } 45% { width: 41%; } 60% { width: 70%; } 80% { width: 83%; } 100% { width: 50%; } }
@media (prefers-reduced-motion: reduce) { .tp-lane .tp-fill { animation: none; } .tp-ladder .tp-bar { transition: none; } }

/* 広告（アリーナ帯の直下・フッター直上）。見本に無い枠なので、帯の余白だけを持たせる */
.tp-ad { text-align: center; padding: 20px 0 0; }
/* アリーナ帯の直下・フッター直上は affstrack 970×90（footer プール） */
.tp-ad .ad-rotator { margin: 0 auto; max-width: 970px; aspect-ratio: 970 / 90; }

/* ---- categories ---- */
.tp-cats { padding: 56px 0 24px; }
.tp-sec-h { font-size: 26px; font-weight: 900; margin: 0 0 6px; }
.tp-sec-p { color: var(--ink-2); margin: 0 0 26px; }
.tp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tp-cat { background: var(--panel); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr auto; }
.tp-cat .tp-band { padding: 12px 20px; color: #fff; font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
/* 見本の opacity .85 は赤帯 #C8373E の上で 4.13:1。4.5:1 に届くよう .92 にした */
.tp-cat .tp-band small { font-size: smaller; font-weight: 500; opacity: .92; }
.tp-cat.tp-try .tp-band { background: var(--chip); }
.tp-cat.tp-keep .tp-band { background: var(--felt); }
.tp-cat.tp-grow .tp-band { background: #2B5797; }
.tp-cat.tp-manage .tp-band { background: #3B4A6B; }
.tp-cat .tp-feat { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.tp-cat .tp-feat h3 { margin: 0 0 6px; font-size: 19px; }
.tp-cat .tp-feat p { margin: 0 0 14px; font-size: 15px; color: var(--ink-2); }
.tp-cat .tp-feat p b { color: var(--ink); font-weight: 700; }
body.top-page .tp-cat .tp-feat .tp-btn { height: 42px; font-size: 15px; padding: 0 18px; }
.tp-cat .tp-more { padding: 12px 20px 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
body.top-page .tp-cat .tp-more a { color: var(--ink-2); border-bottom: 1px solid transparent; }
body.top-page .tp-cat .tp-more a:hover { color: var(--ink); border-color: var(--ink); }

/* ---- 積立・借金 ---- */
.tp-debt { padding: 32px 0 60px; }
.tp-debtbox { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--felt); border-radius: 14px; padding: 26px 28px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; }
.tp-debtbox h2 { font-size: 24px; margin: 0 0 4px; font-weight: 900; }
.tp-debtbox p { margin: 0 0 16px; color: var(--ink-2); }
.tp-debtbox .tp-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tp-debtbox label { font-size: 13px; font-weight: 700; color: var(--ink-2); display: block; margin-bottom: 4px; }
.tp-debtbox .tp-in { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 10px; }
body.top-page .tp-debtbox .tp-in input { border: 0; width: 100%; font: inherit; font-size: 18px; font-weight: 700; text-align: right; outline: 0; color: var(--ink); }
/* 「余裕あり」の緑: 見本の #2E8B57 は白文字に対して 4.24:1。4.5:1 に届くよう少し暗くした */
.tp-judge { border-radius: 12px; padding: 20px 22px; color: #fff; background: #2A8050; min-height: 130px; }
.tp-judge.tp-warn { background: var(--warn); color: var(--ink); }
.tp-judge.tp-danger { background: var(--danger); }
.tp-growbox { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid #2B5797; border-radius: 14px; padding: 26px 28px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; margin-bottom: 20px; }
.tp-growbox h2 { font-size: 24px; margin: 0 0 4px; font-weight: 900; }
.tp-growbox p { margin: 0 0 16px; color: var(--ink-2); }
.tp-growbox .tp-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tp-growbox label { font-size: 13px; font-weight: 700; color: var(--ink-2); display: block; margin-bottom: 4px; }
.tp-growbox .tp-in { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 10px; }
body.top-page .tp-growbox .tp-in input { border: 0; width: 100%; font: inherit; font-size: 18px; font-weight: 700; text-align: right; outline: 0; color: var(--ink); }
.tp-growbox .tp-in span { color: var(--ink-2); font-size: 13px; margin-left: 4px; }
.tp-result { border-radius: 12px; padding: 20px 22px; background: #2B5797; color: #fff; min-height: 130px; }
.tp-result .tp-tag, .tp-judge .tp-tag { font-size: 13px; font-weight: 700; opacity: .85; }
/* 判定欄の「判定」ラベルは色つきの地で半透明にするとコントラストが足りないので不透明にする */
.tp-judge .tp-tag { opacity: 1; }
.tp-result .tp-big { font-size: 34px; font-weight: 900; line-height: 1.1; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.tp-judge .tp-big { font-size: 34px; font-weight: 900; line-height: 1.1; margin: 4px 0 6px; }
.tp-result .tp-sub, .tp-judge .tp-sub { font-size: 14px; line-height: 1.5; }
body.top-page .tp-result a, body.top-page .tp-judge a { display: inline-block; margin-top: 10px; font-weight: 700; border-bottom: 2px solid currentColor; font-size: 14px; }

@media (max-width: 900px) {
    .tp-hero .tp-wrap, .tp-arena .tp-wrap, .tp-debtbox { grid-template-columns: 1fr; }
    .tp-hero { padding: 36px 0 40px; }
    .tp-ladder { height: 180px; }
    .tp-grid2 { grid-template-columns: 1fr; }
    .tp-debtbox .tp-fields { grid-template-columns: 1fr; }
    .tp-growbox { grid-template-columns: 1fr; }
    .tp-growbox .tp-fields { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
 * 共通ヘッダ（include/header.html）を見本の .hd に合わせる（トップだけ）
 * 見本: 高さ 64px の 1 行、左にロゴ（20px / 900、「オンライン」は緑）、右にナビ（16px / 500、間隔 28px）。
 * include の項目（ドロップダウン）はそのまま使い、見本に無い「ホーム」と ▾ は出さない。
 * ============================================================ */
body.top-page header {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    position: relative;
}
body.top-page header > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: var(--maxw);
    padding: 0 20px;
    box-sizing: border-box;
}
body.top-page header .row { width: auto; flex: 0 0 auto; }
body.top-page header .row .col { width: auto; }
body.top-page header .head { display: block; padding: 0; margin: 0; }
body:not(.arena).top-page header .head .site-title { padding: 0; margin: 0; }
body:not(.arena).top-page header .head .site-title a {
    font-size: 20px;
    font-weight: 900;
    line-height: 1.7;
    letter-spacing: .01em;
    color: var(--ink);
}
body.top-page header .site-title b { color: var(--felt); font-weight: 900; }
body.top-page header nav ul.gnav { margin: 0; }
/* grid.css の li { margin-bottom: 1rem } でナビの行が高くなり、中央揃えがずれるのを防ぐ */
body.top-page header #navi .gnav > li { margin: 0; padding: 0; border: 0; }
body:not(.arena).top-page header #navi .gnav { gap: 28px; flex-wrap: nowrap; }
body.top-page header #navi .gnav > li:first-child { display: none; }
body.top-page header .gnav-long { display: none; }
body:not(.arena).top-page header #navi .gnav > li > a,
body:not(.arena).top-page header .gnav-toggle {
    display: inline-block;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 8px 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.7;
    letter-spacing: normal;
    color: var(--ink);
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}
body.top-page header .gnav-toggle::after { content: none; }
body:not(.arena).top-page header #navi .gnav > li > a:hover,
body:not(.arena).top-page header .gnav-group .gnav-toggle:hover,
body:not(.arena).top-page header .gnav-group .gnav-toggle[aria-expanded="true"] {
    background: none;
    color: var(--ink);
    border-color: var(--ink);
}
body:not(.arena).top-page header #navi .gnav > li.gnav-arena > a { color: var(--gold-deep); font-weight: 700; }

@media (min-width: 769px) {
    body.top-page header #open, body.top-page header #close { display: none !important; }
}
@media (max-width: 768px) {
    body.top-page header > .container { position: relative; }
    body.top-page header .head { flex-direction: row; margin: 0; }
    /* 見本の ☰（22px のテキストボタン）。include の画像ボタンを文字に置き換える */
    body.top-page header #open,
    body.top-page header #close {
        position: static;
        width: auto;
        height: auto;
        background: none;
        /* 見本の .burger は <button>: ブラウザ標準のボタンの字形（Arial）と余白 1px 6px で ☰ を描く */
        padding: 1px 6px;
        font: 22px Arial, sans-serif;
        line-height: normal;
        color: var(--ink);
        cursor: pointer;
    }
    body.top-page header #open::before { content: "☰"; }
    body.top-page header #close::before { content: "✕"; }
    body.top-page header #navi {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        z-index: 60;
        background: var(--panel);
        border-bottom: 1px solid var(--line);
        padding: 0 20px 8px;
    }
    body:not(.arena).top-page header #navi .gnav { flex-direction: column; gap: 0; }
    body:not(.arena).top-page header #navi .gnav > li > a,
    body:not(.arena).top-page header .gnav-toggle { display: flex; width: 100%; min-height: 48px; align-items: center; font-size: 17px; }
}

/* ============================================================
 * 共通フッタ（include/footer.html）: トップはフォントだけ見本に揃える（列構成・色は style.css 側で全ページ共通）
 * ============================================================ */
body.top-page footer { font-family: inherit; }
