/* =========================================
   トップページのスタイル
   ========================================= */

/* --- 共通セクション --- */
.section {
    padding: 60px 0;
    position: relative;

    @media (min-width: 768px) {
        padding: 100px 0;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-family: var(--f-serif);
    font-size: 1.8rem;
    color: var(--c-primary);
    margin-bottom: 12px;
    display: inline-block;
    position: relative;

    @media (min-width: 768px) {
        font-size: 2.2rem;
        margin-bottom: 16px;
    }

    &::after {
        content: '';
        display: block;
        width: 60px;
        height: 3px;
        background: var(--c-accent);
        margin: 10px auto 0;
    }
}

/* --- ナビゲーション (PC) --- */
.nav-desk {
    display: flex;
    gap: 40px;
    align-items: center;

    @media (max-width: 768px) {
        display: none;
    }
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--c-text-main);

    &:hover {
        color: var(--c-primary);
    }
}

.btn-dash-nav {
    padding: 8px 20px;
    margin: 0 auto;
    border-radius: 4px;
    background: var(--c-primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;

    &:hover {
        background: #102a4e;
        transform: translateY(-1px);
    }

    &.btn-white {
        background: white;
        color: var(--c-primary);
        padding: 14px 40px;
        font-weight: 700;
    }

    &.btn-outline {
        background: transparent;
        color: var(--c-primary);
        border: 1px solid currentColor;
    }
}

/* --- モバイルメニュー --- */
.mob-dash-btn {
    display: none;
    padding: 6px 14px;
    background: var(--c-primary);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 4px;
    margin-right: 15px;
    margin-left: auto;

    @media (max-width: 768px) {
        display: inline-block;
    }
}

.ham-btn {
    display: none;
    cursor: pointer;

    & span {
        width: 24px;
        height: 2px;
        background: var(--c-primary);
        display: block;
        margin: 6px 0;
    }

    @media (max-width: 768px) {
        display: block;
    }
}

.mob-menu {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;

    &.is-active {
        display: flex;
    }

    & .nav-link {
        font-size: 1.2rem;
    }
}

.mob-close-btn {
    background: #f7fafc;
    border: none;
    color: #2d3748;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- ヒーローセクション --- */
.hero {
    height: 100svh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: white;
    overflow: hidden;

    & .hero-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 0;
    }

    & .hero-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.6);
        background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
        background-size: 30px 30px;
        z-index: 1;
    }

    & .hero-content {
        position: relative;
        z-index: 2;
        text-align: center;
        max-width: 900px;
        padding-bottom: 60px;
    }

    & .hero-surtitle {
        font-family: var(--f-eng);
        font-size: 1.2rem;
        letter-spacing: 0.2em;
        color: var(--c-accent);
        display: block;
        margin-bottom: 24px;
        text-transform: uppercase;
    }

    & .hero-title {
        font-family: var(--f-serif);
        font-size: clamp(2.5rem, 7vw, 5rem);
        line-height: 1.2;
        margin-bottom: 32px;
        text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);

        @media (max-width: 768px) {
            font-size: 2.5rem;
        }
    }

    & .hero-desc {
        font-size: clamp(1rem, 2vw, 1.2rem);
        margin-bottom: 48px;
        opacity: 0.9;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
}

/* --- ニュースブリッジ (Hero内) --- */
.news-bridge {
    position: absolute;
    top: auto;
    bottom: 20px;
    left: 0;
    width: 100%;
    z-index: 10;
    padding: 0 20px;

    @media (max-width: 767px) {
        bottom: 85px;
        padding: 0 15px;
    }
}

.news-card-hero {
    background: rgba(26, 54, 93, 0.9);
    backdrop-filter: blur(4px);
    border-left: 4px solid var(--c-accent);
    max-width: 900px;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 15px;
    color: white;
    transition: transform 0.2s;

    &:hover {
        transform: translateY(-2px);
        background: rgba(26, 54, 93, 1);
    }

    @media (min-width: 768px) {
        padding: 20px 30px;
        gap: 20px;
    }

    @media (max-width: 600px) {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px 16px;
    }

    & .badge-news-hero {
        background: var(--c-accent);
        color: white;
        padding: 3px 10px;
        font-size: 0.75rem;
        font-weight: 700;
        border-radius: 99px;
        font-family: var(--f-eng);
        white-space: nowrap;
    }

    & .news-hero-title {
        flex: 1;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.95rem;

        @media (min-width: 768px) {
            font-size: 1.2rem;
        }

        @media (max-width: 600px) {
            white-space: normal;
            overflow: visible;
            line-height: 1.4;
        }
    }

    & .news-date {
        @media (max-width: 767px) {
            font-size: 0.75rem;
            color: #a0aec0;
        }
    }
}

/* --- 大会リスト --- */
.latest-section {
    padding-top: 180px;
    padding-bottom: 80px;
    background: var(--c-bg);

    @media (max-width: 768px) {
        padding-top: 200px;
    }
}

.tour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }
}

.tour-card {
    background: var(--c-surface);
    border-radius: 8px;
    overflow: hidden;
    border: var(--border);
    transition: 0.3s;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;

    &:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
        border-color: var(--c-primary);
    }
}

.tour-status {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    text-align: center;

    &.status-open {
        background: var(--c-accent);
    }

    &.status-upcoming {
        background: var(--c-gold);
    }

    &.status-closed {
        background: var(--c-text-muted);
    }
}

.tour-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    & .tour-title {
        font-family: var(--f-serif);
        font-size: 1.25rem;
        color: var(--c-primary);
        margin-bottom: 10px;
        font-weight: 700;
    }

    & .tour-meta {
        font-size: 0.9rem;
        color: var(--c-text-muted);
        margin-bottom: 15px;

        & div {
            display: flex;
            gap: 8px;
            margin-bottom: 4px;
            align-items: center;
        }
    }
}

/* JS挿入クラス */
.cast-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #718096;
    margin-top: 5px;

    &.mt-2 {
        margin-top: 2px;
    }
}

.cast-label {
    background: #edf2f7;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.tour-date-stress {
    font-weight: 800;
    color: var(--c-primary);
    font-size: 1.25rem;
    background: #bee3f8;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.tour-entry-stress {
    color: #3182ce;
    font-weight: 700;
    margin-top: 10px;
    text-align: right;
    display: block;
}

.tour-result-link {
    margin-top: 10px;
    text-align: right;
    font-size: 0.85rem;
    color: #718096;
    font-weight: bold;
    display: block;
}

/* --- スケジュール (Timeline) --- */
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    margin-top: 40px;
}

.timeline-line {
    position: absolute;
    left: 24px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: #cbd5e0;
}

.timeline-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 60px;
}

.timeline-dot {
    position: absolute;
    left: 17px;
    top: 0;
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--c-primary);
    border-radius: 50%;
    z-index: 1;
}

.timeline-date {
    font-family: var(--f-serif);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--c-accent);
    margin-bottom: 8px;
}

.timeline-content {
    & h3 {
        font-size: 1.5rem;
        margin-bottom: 12px;
        color: var(--c-primary);
    }

    & p {
        color: var(--c-text-muted);
    }
}

.tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    margin-left: 8px;
    color: var(--c-primary);
    background: rgba(26, 54, 93, 0.1);
}

.other-tours-box {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    border: 1px dashed #cbd5e0;
    border-radius: 8px;
}

/* --- ニュースリスト --- */
.news-list-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    border: var(--border);
    overflow: hidden;
}

.news-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #edf2f7;
    align-items: flex-start;
    text-align: left;
    transition: background 0.2s;

    &:last-child {
        border-bottom: none;
    }

    &:hover {
        background: #f8fafc;
    }

    @media (max-width: 600px) {
        flex-direction: column;
        gap: 8px;
        padding: 15px;
    }
}

.news-meta {
    display: flex;
    flex-direction: column;
    min-width: 100px;
    gap: 4px;

    @media (max-width: 600px) {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }
}

.news-date {
    color: var(--c-text-muted);
    font-family: var(--f-eng);
    font-size: 0.85rem;
}

.news-cat {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #edf2f7;
    color: var(--c-text-muted);
    width: fit-content;

    &.badge-important {
        background: #e53e3e;
        color: white;
    }

    &.badge-recruit {
        background: #38a169;
        color: white;
    }

    &.badge-info {
        background: #2b6cb0;
        color: white;
    }

    &.status-upcoming {
        background: var(--c-gold);
        color: white;
    }
}

.news-item-title {
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--c-text-main);
}

/* --- SNSセクション --- */
.sns-section {
    background: white;
    padding: 80px 0;
    text-align: center;
}

.sns-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;

    @media (max-width: 768px) {
        flex-direction: column;
        gap: 30px;
    }
}

.sns-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: var(--c-primary);

    & .sns-icon-box {
        width: 60px;
        height: 60px;
        background: #f7fafc;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.3s;
        color: var(--c-text-main);
    }

    &:hover .sns-icon-box {
        background: var(--c-primary);
        color: white;
        transform: scale(1.1);
    }
}

/* --- CTA バー --- */
.cta-bar {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    border: 1px solid var(--c-primary);
    border-radius: 8px;
    padding: 20px;
    z-index: 900;
    box-shadow: var(--shadow-lg);
    width: 280px;
    transition: 0.3s;

    &.hidden {
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
    }
}

.btn-cta {
    background: var(--c-accent);
    color: white;
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    font-weight: 700;
    margin-top: 10px;
}

/* --- 結果モーダル --- */
.res-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;

    &.active {
        display: flex;
        /* Added to override display: none */
        opacity: 1;
        pointer-events: auto;
    }
}

.res-modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    padding: 25px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s;
    padding-top: 50px;

    /* アクティブ時の親要素 */
    .res-modal-overlay.active & {
        transform: translateY(0);
    }
}

.res-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #edf2f7;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 1.2rem;
    color: #718096;
    transition: 0.2s;
    z-index: 20;

    &:hover {
        background: #cbd5e0;
        color: #2d3748;
    }
}

.res-img-box {
    width: 100%;
    aspect-ratio: 16/9;
    background: #1a202c;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;

    & img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.res-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 15px;
}

.res-winner-badge {
    background: #FFD700;
    color: #333;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: inline-block;
}

.res-team-name {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--c-primary);
    line-height: 1.1;
    margin: 10px 0;
    background: linear-gradient(45deg, var(--c-primary), #2b6cb0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));

    @media (max-width: 600px) {
        font-size: 2rem;
    }
}

.res-univ-info {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4a5568;
    margin-top: 5px;
}

.res-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 30px;
}

.res-mem-pill {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--c-primary);
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.res-cast-area {
    margin-top: 25px;
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
}

.cast-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;

    &:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
}

.cast-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cast-role {
    font-size: 0.75rem;
    background: #2d3748;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
}

.cast-name {
    font-weight: bold;
    font-size: 0.95rem;
}

.cast-links {
    display: flex;
    gap: 8px;
}

.cast-link-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 1px solid #cbd5e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
    transition: 0.2s;

    &:hover {
        color: #3182ce;
        border-color: #3182ce;
    }
}

.res-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-res-rich {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 700;
    transition: 0.2s;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 10px -1px rgba(0, 0, 0, 0.15);
    }
}

.btn-res-post {
    background: #000;
    color: white;
    border: none;
}

.btn-res-archive {
    background: transparent;
    border: 1px solid #cbd5e0;
    color: #4a5568;

    &:hover {
        background: #f7fafc;
        border-color: #a0aec0;
    }
}