/* ===== 全体設定：ダーク＆インパクト ===== */
body {
    font-family: serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    color: #e0e0e0;
    overflow-x: hidden;
    background-image: url('/img/kuriha_haikei.png');
    background-color: #000;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 40px;
}

/* ===== トップメッセージ：巨大化 ===== */
.top-message {
    text-align: center;
    margin-bottom: 100px;
    padding-top: 22vh;
    padding-left: 20px;
    padding-right: 20px;
    opacity: 0;
    animation: fadeInSlow 1.5s 0.5s ease-out forwards;
}

.top-message p {
    font-size: 4.5rem;
    line-height: 1.4;
    margin: 15px 0;
    font-weight: bold;
    letter-spacing: .1em;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* ===== ロゴセクションのスタイル ===== */
.logo-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 200px;
    padding-left: 20px;
    padding-right: 20px;
    opacity: 0;
    animation: fadeInSlow 2s 1.8s ease-out forwards;
}

@keyframes fadeInSlow {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-logo-img {
    height: 150px;
    width: auto;
}

.header-logo-text {
    font-size: 5rem;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(218, 165, 32, 0.5);
    margin: 0;
}

/* ===== 各セクションと見出し ===== */
.content-section {
    margin-bottom: 120px;
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.content-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    margin-bottom: 60px;
    font-size: 3.5rem;
    text-align: center;
    width: 100%;
    color: #fff;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 30%;
    height: 4px;
    background-color: #daa520;
    box-shadow: 0 0 10px #daa520;
    transition: transform 1s cubic-bezier(0.165, 0.84, 0.44, 1) 0.5s;
    transform-origin: center;
}

.is-visible .section-title::after {
    transform: translateX(-50%) scaleX(1);
}

.section-subtitle {
    font-size: 1.1rem;
    color: #aaa;
    text-align: center;
    margin-top: -50px;
    margin-bottom: 40px;
    letter-spacing: .05em;
}

/* ===== カードレイアウト：ダーク＆豪華 ===== */
.card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
}

.card {
    background-color: rgba(30, 30, 30, 0.9);
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* ▼▼▼ 画像削除に伴いレイアウト調整 ▼▼▼ */
.card-top {
    padding: 25px 25px 15px 25px; /* パディングを調整 */
    text-align: center; /* テキストを中央寄せ */
}

/* card-image のスタイルは不要なので削除 */

.card-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.6rem;
    color: #fff;
}

.card-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #bbb;
    line-height: 1.6;
}

.card-description {
    padding: 0 30px 30px 30px;
    font-size: 1rem;
    line-height: 1.7;
    text-align: center; /* 説明文も中央寄せに */
}

/* ===== カード内要素のアニメーション：よりダイナミックに ===== */
.card-info, .card-description {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
/* ▼▼▼ アニメーションの方向を調整 ▼▼▼ */
.card-info { transform: translateY(-40px); }
.card-description { transform: translateY(-40px); }

/* is-visible .card-image の指定は不要 */

.is-visible .card-info {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.8s; /* 表示タイミングを早める */
}
.is-visible .card-description {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.0s; /* 表示タイミングを早める */
}

/* ===== S1レース紹介：タイムライン風デザイン ===== */
.race-timeline {
    display: flex;
    flex-direction: column;
    gap: 70px;
}

.timeline-category {
    position: relative;
    padding-left: 220px;
    min-height: 90px;
}

.age-group {
    position: absolute;
    left: 0;
    top: 0;
    width: 180px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.age-group h3 {
    font-size: 2.2rem;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    position: relative;
}

.age-group h3::after {
    content: '—';
    color: #daa520;
    margin-left: 15px;
}

.timeline-category::before {
    content: '';
    position: absolute;
    left: 200px;
    top: 1.6rem;
    width: calc(100% - 200px);
    height: 3px;
    background: #444;
}

.timeline-category::after {
    content: '';
    position: absolute;
    left: 200px;
    top: 1.6rem;
    width: calc(100% - 200px);
    height: 3px;
    background: linear-gradient(90deg, #daa520, #c5b358);
    box-shadow: 0 0 10px #daa520;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s ease-out 0.8s;
}

.is-visible .timeline-category::after {
    transform: scaleX(1);
}

.race-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    padding-top: 50px;
}

.race-card {
    background-color: rgba(30, 30, 30, 0.9);
    border: 1px solid #444;
    padding: 18px;
    flex-grow: 1;
    min-width: 260px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out 1.5s, transform 0.7s ease-out 1.5s;
}

.is-visible .race-card {
    opacity: 1;
    transform: translateY(0);
}

.race-card::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 3px;
    height: 50px;
    background-color: #444;
    transform-origin: bottom;
    transform: scaleY(0) translateX(-50%);
    transition: transform 0.6s ease-out 1.2s;
}

.is-visible .race-card::before {
    transform: scaleY(1) translateX(-50%);
}

.race-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: #daa520;
}

.race-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
}

.season-group-container {
    display: flex;
    gap: 50px;
    width: 100%;
    padding-top: 50px;
}

.season-group {
    flex: 1;
    position: relative;
}

.season-group::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 20px;
    width: 3px;
    height: calc(100% - 50px);
    background: #daa520;
    box-shadow: 0 0 8px #daa520;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1s ease-out 1.5s;
}

.is-visible .season-group::before {
    transform: scaleY(1);
}

.season-title {
    font-size: 1.6rem;
    color: #fff;
    margin: 0 0 25px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #555;
    position: relative;
}

.season-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30%;
    height: 2px;
    background: #daa520;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s ease-out 1.8s;
}

.is-visible .season-title::after {
    transform: scaleX(1);
}

.season-race-cards {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding-left: 40px;
}

.season-group .race-card::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: #444;
    transform: translateY(-50%) scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease-out;
}

.season-group .race-card {
    opacity: 0;
    transform: translateX(20px);
    transition-property: opacity, transform;
    transition-duration: 0.6s;
    transition-timing-function: ease-out;
}

.is-visible .season-group .race-card {
    opacity: 1;
    transform: translateX(0);
}

.is-visible .season-group .race-card:nth-of-type(1)::before { transition-delay: 2.0s; transform: translateY(-50%) scaleX(1); }
.is-visible .season-group .race-card:nth-of-type(1) { transition-delay: 2.2s; }
.is-visible .season-group .race-card:nth-of-type(2)::before { transition-delay: 2.4s; transform: translateY(-50%) scaleX(1); }
.is-visible .season-group .race-card:nth-of-type(2) { transition-delay: 2.6s; }
.is-visible .season-group .race-card:nth-of-type(3)::before { transition-delay: 2.8s; transform: translateY(-50%) scaleX(1); }
.is-visible .season-group .race-card:nth-of-type(3) { transition-delay: 3.0s; }
.is-visible .season-group .race-card:nth-of-type(4)::before { transition-delay: 3.2s; transform: translateY(-50%) scaleX(1); }
.is-visible .season-group .race-card:nth-of-type(4) { transition-delay: 3.4s; }
.is-visible .season-group .race-card:nth-of-type(5)::before { transition-delay: 3.6s; transform: translateY(-50%) scaleX(1); }
.is-visible .season-group .race-card:nth-of-type(5) { transition-delay: 3.8s; }

.subtitle {
    font-size: 1.1rem;
    color: #ccc;
    margin-top: 5px;
    letter-spacing: .1em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out 0.5s, transform 0.8s ease-out 0.5s;
}

.is-visible .subtitle {
    opacity: 1;
    transform: translateY(0);
}

.timeline-category::before,
.timeline-category::after {
    top: 1.6rem;
}

/* ===== 歴史セクション：左右交互タイムライン ===== */
.history-container {
    position: relative;
}

.history-group {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.8s ease, max-height 1s ease;
}

.history-group.is-shown {
    opacity: 1;
    max-height: 5000px;
}

.history-timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
}

.history-timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: #444;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1s ease-out 0.5s;
}

.is-shown .history-timeline::after {
    transform: scaleY(1);
}

.history-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.history-item:nth-child(odd) {
    left: 0;
}

.history-item:nth-child(even) {
    left: 50%;
}

.is-shown .history-item:nth-child(1) { transition-delay: 1.2s; }
.is-shown .history-item:nth-child(2) { transition-delay: 1.6s; }
.is-shown .history-item:nth-child(3) { transition-delay: 2.0s; }
.is-shown .history-item:nth-child(4) { transition-delay: 2.4s; }
.is-shown .history-item:nth-child(5) { transition-delay: 2.8s; }
.is-shown .history-item:nth-child(6) { transition-delay: 3.2s; }
.is-shown .history-item:nth-child(7) { transition-delay: 3.6s; }
.is-shown .history-item:nth-child(8) { transition-delay: 4.0s; }
.is-shown .history-item:nth-child(9) { transition-delay: 4.4s; }
.is-shown .history-item:nth-child(10) { transition-delay: 4.8s; }
.is-shown .history-item:nth-child(11) { transition-delay: 5.2s; }
.is-shown .history-item:nth-child(12) { transition-delay: 5.6s; }
.is-shown .history-item:nth-child(13) { transition-delay: 6.0s; }
.is-shown .history-item:nth-child(14) { transition-delay: 6.4s; }
.is-shown .history-item:nth-child(15) { transition-delay: 6.8s; }
.is-shown .history-item:nth-child(16) { transition-delay: 7.2s; }
.is-shown .history-item:nth-child(17) { transition-delay: 7.6s; }

.is-shown .history-item {
    opacity: 1;
    transform: translateY(0);
}

.history-item::after {
    content: ' ';
    position: absolute;
    top: 28px;
    width: 0;
    height: 0;
    border: 15px solid transparent;
}

.history-item:nth-child(odd)::after {
    right: 10px;
    border-left-color: #daa520;
}

.history-item:nth-child(even)::after {
    left: 10px;
    border-right-color: #daa520;
}

.history-card {
    padding: 18px 25px;
    background-color: rgba(30, 30, 30, 0.9);
    border: 1px solid #444;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.history-card h5 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: #daa520;
}

.history-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
}

.next-story-btn {
    text-align: center;
    padding: 30px 0;
}

.next-story-btn a {
    font-size: 1.3rem;
    color: #daa520;
    text-decoration: none;
    border: 2px solid #daa520;
    padding: 8px 25px;
    transition: all 0.3s ease;
}

.next-story-btn a:hover {
    background-color: #daa520;
    color: #121212;
    box-shadow: 0 0 15px #daa520;
}

.history-ender {
    position: relative;
    padding-top: 30px;
    text-align: center;
    opacity: 0;
    transition: opacity 1.5s ease-in 1s;
}

.is-shown .history-ender {
    opacity: 1;
}

.history-ender p {
    font-size: 1.3rem;
    font-style: italic;
    color: #777;
    letter-spacing: .1em;
}

.footer-nav {
    text-align: center;
    padding: 40px 0 80px 0;
}

.home-btn {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    background-color: #daa520;
    padding: 15px 60px;
    text-decoration: none;
    letter-spacing: .1em;
    box-shadow: 0 5px 20px rgba(218, 165, 32, 0.4);
    transition: all 0.3s ease;
}

.home-btn:hover {
    background-color: #fff;
    color: #121212;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

.race-notes {
    margin-top: 40px;
    padding-left: 20px;
    border-left: 3px solid #555;
    /* ▼▼▼ アニメーション設定を追加 ▼▼▼ */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

/* 表示された時にアニメーションを実行 */
.is-visible .race-notes {
    opacity: 1;
    transform: translateY(0);
    /* 他のカードが表示された後に注釈を表示するための遅延 */
    transition-delay: 4s;
}

.race-notes p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #bbb;
    line-height: 1.6;
}

