/* ===== 未来への航路（ライフマップ） ===== */

/* クリアリティバー */
.lm-clarity-bar {
    height: 10px;
    background: var(--bg-warm);
    border-radius: 10px;
    overflow: hidden;
}
.lm-clarity-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #D4897A, #f7d060, #5B8C6A);
    transition: width 1.5s ease;
}

/* タイムライン中央の航路 */
.lm-timeline-track {
    position: absolute;
    left: 50%;
    top: 60px;
    bottom: 60px;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-light), var(--border) 60%, rgba(200,200,200,0.2));
    transform: translateX(-50%);
    border-radius: 4px;
    overflow: hidden;
}

.lm-path-glow {
    width: 100%;
    background: linear-gradient(180deg, #f7d060, var(--accent), transparent);
    border-radius: 4px;
    opacity: 0.7;
    transition: height 2s ease;
}

/* 起点ドット */
.lm-origin {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
    z-index: 2;
}
.lm-origin-dot {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border: 3px solid white;
    border-radius: 50%;
    margin: 0 auto 8px;
    box-shadow: 0 0 12px rgba(157, 192, 139, 0.6);
    animation: lm-pulse 2s ease-in-out infinite;
}
.lm-origin span {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-main);
}

@keyframes lm-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(157, 192, 139, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 24px rgba(157, 192, 139, 0.8); transform: scale(1.15); }
}

/* タイムラインノード配置 */
.lm-timeline-nodes {
    position: relative;
}

/* 年マーカー（5年刻み） */
.lm-year-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}
.lm-year-marker span {
    display: inline-block;
    background: var(--bg-warm);
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* マイルストーンノード */
.lm-node {
    position: absolute;
    width: 45%;
    z-index: 3;
}
.lm-node-left {
    left: 2%;
}
.lm-node-right {
    right: 2%;
}

.lm-node-connector {
    position: absolute;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-light), var(--border));
    z-index: 1;
}
.lm-node-left .lm-node-connector {
    right: -8%;
    width: 8%;
}
.lm-node-right .lm-node-connector {
    left: -8%;
    width: 8%;
}

.lm-node-card {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 18px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.lm-node-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.lm-node-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.lm-node-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
}
.lm-node-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* 達成済み */
.lm-achieved {
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, #f0f7ec 0%, white 100%);
}
.lm-achieved .lm-node-title::after {
    content: ' ✅';
}

/* 近い未来（5年以内） */
.lm-near {
    border-left: 4px solid #f7d060;
}
.lm-near .lm-node-icon {
    animation: lm-near-glow 3s ease-in-out infinite;
}

@keyframes lm-near-glow {
    0%, 100% { box-shadow: 0 4px 12px rgba(247, 208, 96, 0.2); }
    50% { box-shadow: 0 4px 20px rgba(247, 208, 96, 0.5); }
}

/* (old-age card removed) */

/* --- 労いメッセージ --- */
.praise-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f5f0e6 0%, #f2ede3 100%);
    border-radius: 14px;
    border-left: 4px solid #C4A265;
}
.praise-message.cooking-bonus {
    background: linear-gradient(135deg, #edf5ef 0%, #f5f0e6 100%);
    border-left-color: var(--success);
    animation: praise-glow 2s ease-in-out;
}
@keyframes praise-glow {
    0% { box-shadow: 0 0 0 rgba(91, 140, 106, 0); }
    50% { box-shadow: 0 0 20px rgba(91, 140, 106, 0.2); }
    100% { box-shadow: 0 0 0 rgba(91, 140, 106, 0); }
}
.praise-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.praise-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.praise-text strong {
    color: var(--text-main);
    font-weight: 800;
}

/* --- ライフステージバッジ（ホーム） --- */
.life-stage-badge {
    transition: transform 0.2s ease;
}
.life-stage-badge:hover {
    transform: translateX(4px);
}

/* --- 家族イベントノード（ライフマップ） --- */
.lm-family {
    border-left: 4px solid var(--warning);
    background: linear-gradient(135deg, #f5f0e6 0%, white 100%);
}
.lm-family .lm-node-title {
    color: var(--warning);
}

/* (READY_TO_BUY card removed) */

/* --- 自炊メッセージ中間・低ティア --- */
.praise-message.cooking-mid {
    background: linear-gradient(135deg, #edf5ef 0%, #f5f0e6 100%);
    border-left-color: var(--info);
}
.praise-message.cooking-low {
    background: linear-gradient(135deg, #f5f0e6 0%, #fef0ec 100%);
    border-left-color: var(--warning);
}

/* --- 家賃 vs 住宅ローン＋団信 比較 --- */
.lmh-compare-section {
    padding: 28px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--border);
    letter-spacing: 0.3px;
}
.lmh-compare-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}
.lmh-compare-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.lmh-compare-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 900;
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 6px;
}
.lmh-compare-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.7;
}
.lmh-compare-subtitle strong {
    color: var(--primary-dark);
    background: linear-gradient(transparent 60%, rgba(91, 140, 106, 0.15) 60%);
    padding: 0 2px;
}
.lmh-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.lmh-compare-card {
    padding: 24px 20px;
    border-radius: 18px;
    text-align: center;
}
.lmh-compare-card-label {
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}
.lmh-compare-card-title {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.5;
}
.lmh-compare-amount {
    font-size: 1.6rem;
    font-weight: 900;
    margin: 12px 0;
    transition: color 0.3s ease;
}
.lmh-compare-amount-rent { color: #bf360c; }
.lmh-compare-amount-loan { color: #1b5e20; }
.lmh-compare-breakdown {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.lmh-compare-card-desc {
    font-size: 0.75rem;
    line-height: 1.6;
    padding-top: 12px;
    border-top: 1px dashed rgba(0,0,0,0.08);
}
/* 賃貸側: シェルピンク */
.lmh-compare-rent {
    background: linear-gradient(135deg, #fff0f2, #ffe8ec);
    border: 1px solid rgba(255, 183, 197, 0.3);
}
.lmh-compare-rent .lmh-compare-card-label { color: #bf360c; }
.lmh-compare-rent .lmh-compare-card-title { color: #6d4c41; }
.lmh-compare-rent .lmh-compare-card-desc { color: #8d6e63; }
/* 住宅ローン側: ピスタチオグリーン + やわらかい光 */
.lmh-compare-loan {
    background: linear-gradient(145deg, #f0f8ec 0%, #e0f2f1 60%, rgba(255,255,255,0.85) 100%);
    border: 1px solid rgba(157, 192, 139, 0.3);
    box-shadow: 0 0 20px rgba(157, 192, 139, 0.15);
    animation: compare-loan-glow 3s ease-in-out infinite;
}
.lmh-compare-loan .lmh-compare-card-label { color: var(--primary-dark); }
.lmh-compare-loan .lmh-compare-card-title { color: #3A6B49; }
.lmh-compare-loan .lmh-compare-card-desc { color: #5B8C6A; font-weight: 600; }
@keyframes compare-loan-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(157, 192, 139, 0.12); }
    50% { box-shadow: 0 0 35px rgba(157, 192, 139, 0.25); }
}
.lmh-compare-meyasu {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 4px;
    letter-spacing: 0;
}
/* 団信説明フッター */
.lmh-compare-footer {
    margin-top: 18px;
    padding: 12px 16px;
    background: rgba(91, 140, 106, 0.06);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- CTAセクション（ミライの地図ページ） --- */
.lmh-cta-section {
    margin-top: 30px;
    text-align: center;
    padding: 45px 30px;
    background: linear-gradient(135deg, #fff 0%, #fff0f5 40%, #e0f2f1 100%);
    border-radius: 20px;
    border: 1px solid var(--border);
    letter-spacing: 0.5px;
}
.lmh-cta-text {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 30px;
}
.lmh-cta-btn-wrapper {
    position: relative;
    display: inline-block;
}
.lmh-cta-btn {
    background: linear-gradient(135deg, var(--primary-dark), #d4817f);
    color: white;
    border: none;
    padding: 18px 45px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 0 #4A7A59, 0 12px 25px rgba(91, 140, 106, 0.35);
    transition: all 0.15s ease;
    letter-spacing: 1px;
}
.lmh-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #4A7A59, 0 16px 30px rgba(91, 140, 106, 0.45);
}
.lmh-cta-btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #4A7A59, 0 6px 15px rgba(91, 140, 106, 0.25);
}
.lmh-cta-badge {
    position: absolute;
    top: -14px;
    right: -18px;
    background: white;
    border: 2px solid var(--primary-light);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--primary-dark);
    transform: rotate(6deg);
    font-family: 'Zen Kaku Gothic New', sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    white-space: nowrap;
}
.lmh-cta-hint {
    margin-top: 20px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== 横軸ロードマップ（ミライの地図） ===== */

.lmh-wrapper {
    padding: 30px 20px 20px;
    position: relative;
    overflow: hidden;
}

/* --- 年齢並走エリア --- */
.lmh-age-area {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}
.lmh-age-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.lmh-age-label {
    width: 80px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-main);
    flex-shrink: 0;
    white-space: nowrap;
}
.lmh-age-track {
    flex: 1;
    position: relative;
    height: 22px;
    background: var(--bg-warm);
    border-radius: 11px;
}
.lmh-age-tick {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- メインタイムライン --- */
.lmh-timeline-area {
    position: relative;
    height: 460px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}
.lmh-timeline-area::-webkit-scrollbar {
    height: 6px;
}
.lmh-timeline-area::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

/* トラック背景線 */
.lmh-track-bg {
    position: absolute;
    top: 140px;
    left: 40px;
    right: 40px;
    height: 4px;
    z-index: 1;
}
.lmh-track-line {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--border) 60%, rgba(200,200,200,0.2));
    border-radius: 4px;
}
.lmh-track-glow {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #f7d060, var(--accent), transparent);
    border-radius: 4px;
    opacity: 0.7;
    transition: width 2s ease;
}

/* 起点ドット */
.lmh-origin {
    position: absolute;
    left: 10px;
    top: 124px;
    text-align: center;
    z-index: 5;
}
.lmh-origin-dot {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 3px solid white;
    border-radius: 50%;
    margin: 0 auto 6px;
    box-shadow: 0 0 12px rgba(157, 192, 139, 0.6);
    animation: lm-pulse 2s ease-in-out infinite;
}
.lmh-origin span {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

/* 終点 */
.lmh-destination {
    position: absolute;
    right: 10px;
    top: 124px;
    text-align: center;
    z-index: 5;
}
.lmh-destination span {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

/* 年マーカー（横） */
.lmh-year-marker {
    position: absolute;
    top: 148px;
    transform: translateX(-50%);
    z-index: 2;
}
.lmh-year-marker span {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-warm);
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* --- たからもの（ノード） --- */
.lmh-node {
    position: absolute;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    cursor: default;
    transition: filter 1s ease, opacity 1s ease;
}

/* ママレーン (lane-0) 上段 ＋千鳥配置 */
.lmh-lane-0 {
    top: 5px;
}
.lmh-lane-0.lmh-chidori-1 {
    top: 42px;
}

/* 子供レーン1 (lane-1) 下段 ＋千鳥配置 */
.lmh-lane-1 {
    top: 165px;
}
.lmh-lane-1.lmh-chidori-1 {
    top: 192px;
}

/* 子供レーン2 (lane-2) さらに下段 ＋千鳥配置 */
.lmh-lane-2 {
    top: 280px;
}
.lmh-lane-2.lmh-chidori-1 {
    top: 307px;
}

/* 子供レーンはコンパクト表示 */
.lmh-lane-1 .lmh-pin,
.lmh-lane-2 .lmh-pin {
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
}
.lmh-lane-1 .lmh-node-line,
.lmh-lane-2 .lmh-node-line {
    height: 22px;
}
.lmh-lane-1 .lmh-node-card,
.lmh-lane-2 .lmh-node-card {
    padding: 5px 8px;
    min-width: 80px;
    max-width: 120px;
}
.lmh-lane-1 .lmh-node-title,
.lmh-lane-2 .lmh-node-title {
    font-size: 0.62rem;
}
.lmh-lane-1 .lmh-node-meta,
.lmh-lane-2 .lmh-node-meta {
    font-size: 0.55rem;
}

/* 子供レーン区切り線 */
.lmh-child-track {
    position: absolute;
    left: 40px;
    right: 40px;
    height: 1px;
    background: linear-gradient(90deg, rgba(233, 30, 140, 0.3), rgba(233, 30, 140, 0.1) 60%, transparent);
    z-index: 2;
}
.lmh-child-track-label {
    position: absolute;
    left: 0;
    top: -14px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--warning);
    white-space: nowrap;
}

.lmh-pin {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 3;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.lmh-node:hover .lmh-pin {
    transform: scale(1.15);
    box-shadow: 0 6px 25px rgba(0,0,0,0.18);
}
.lmh-node-line {
    width: 2px;
    height: 60px;
    background: linear-gradient(180deg, var(--border), transparent);
    margin: 0 auto;
}
.lmh-node-card {
    padding: 8px 10px;
    border-radius: 12px;
    text-align: center;
    min-width: 100px;
    max-width: 140px;
    transition: transform 0.3s ease;
}
.lmh-node:hover .lmh-node-card {
    transform: translateY(-3px);
}
.lmh-node-title {
    font-weight: 800;
    font-size: 0.7rem;
    color: var(--text-main);
    line-height: 1.3;
    word-break: keep-all;
}
.lmh-node-meta {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* たからもの状態 */
.lmh-achieved .lmh-pin {
    border: 3px solid var(--accent);
}
.lmh-achieved .lmh-node-title::after {
    content: ' ✅';
}
.lmh-near .lmh-pin {
    border: 3px solid #C4A265;
    animation: lm-near-glow 3s ease-in-out infinite;
}
.lmh-family .lmh-pin {
    border: 3px solid var(--warning);
}
.lmh-family .lmh-node-title {
    color: var(--warning);
}
.lmh-family .lmh-node-line {
    background: linear-gradient(180deg, var(--warning), transparent);
}

/* --- 密集おまとめ（クラスタ） --- */
.lmh-cluster {
    position: absolute;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: filter 1s ease, opacity 1s ease;
}
.lmh-cluster.lmh-lane-0 {
    top: 15px;
}
.lmh-cluster.lmh-lane-1 {
    top: 165px;
}
.lmh-cluster.lmh-lane-2 {
    top: 280px;
}
.lmh-cluster-icons {
    display: flex;
    gap: 3px;
    background: white;
    padding: 8px 12px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    font-size: 1.2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.lmh-cluster:hover .lmh-cluster-icons {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(0,0,0,0.18);
}
.lmh-cluster-count {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
}
.lmh-cluster .lmh-node-line {
    height: 30px;
}
.lmh-cluster-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    min-width: 210px;
    max-width: 280px;
    padding: 14px 16px;
    border-radius: 14px;
    background: white;
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 20;
}
.lmh-cluster:hover .lmh-cluster-popup {
    display: block;
}
.lmh-cluster-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.lmh-cluster-item:last-child {
    border-bottom: none;
}
.lmh-cluster-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.lmh-cluster-item-title {
    font-weight: 800;
    font-size: 0.72rem;
    color: var(--text-main);
}
.lmh-cluster-item-meta {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- 霧オーバーレイ --- */
.lmh-fog {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,253,248,0.4) 30%, rgba(255,253,248,0.85) 70%, rgba(255,253,248,0.95) 100%);
    pointer-events: none;
    z-index: 6;
    transition: opacity 2.5s ease;
}
