/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    color: #333;
    line-height: 1.6;
    padding-top: 64px;
}

/* Header Styles */
.header {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 16px 32px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.3s ease-in-out;
}

.header.hidden {
    transform: translateY(-100%);
}

.header-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
}

.header-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.header-nav a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: #8b5cf6;
}

/* Common Page Structure */
.page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px 32px;
}

/* Footer Styles */
.footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 24px 32px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-content a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-content a:hover {
    color: #8b5cf6;
}

.footer-copyright {
    color: #999;
    font-size: 0.85rem;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #8b5cf6;
    margin-bottom: 24px;
    border-bottom: 2px solid #8b5cf6;
    padding-bottom: 8px;
}

/* Common Section Styles */
.info-section {
    margin-bottom: 30px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Common Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 8px;
}

.badge-rarity {
    background: #e0e0e0;
    color: #666;
}

/* Common Link Styles */
.back-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: inline-block;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* Detail Page Background Pattern */
.detail-page-background {
    margin: 0;
    min-height: 200vh;
    padding-top: 64px;
    padding-left: 20px;
    padding-right: 20px;
    position: relative;
    background:
        repeating-linear-gradient(
            -20deg,
            /* MAIN color block (top) */
            var(--main-color, #FCA7FF) 0%,
            var(--main-color, #FCA7FF) 19.9%,
            /* BACKGROUND transparent */
            transparent 19.9%,
            transparent 27.1%,
            /* thin MAIN color line */
            var(--main-color, #FCA7FF) 27.1%,
            var(--main-color, #FCA7FF) 27.7%,
            /* BACKGROUND transparent */
            transparent 27.7%,
            transparent 43.4%,
            /* thin SUB color line */
            var(--sub-color, #FF58D9) 43.4%,
            var(--sub-color, #FF58D9) 43.9%,
            /* SUB color band */
            var(--sub-color, #FF58D9) 43.9%,
            var(--sub-color, #FF58D9) 56.0%,
            /* thin SUB color line */
            var(--sub-color, #FF58D9) 56.0%,
            var(--sub-color, #FF58D9) 56.5%,
            /* BACKGROUND transparent */
            transparent 56.5%,
            transparent 74.1%,
            /* MAIN color band */
            var(--main-color, #FCA7FF) 74.1%,
            var(--main-color, #FCA7FF) 81.3%,
            /* BACKGROUND transparent */
            transparent 81.3%,
            transparent 99.5%,
            /* thin SUB color line */
            var(--sub-color, #FF58D9) 99.5%,
            var(--sub-color, #FF58D9) 100%,
            /* End with MAIN color to match start for seamless loop */
            var(--main-color, #FCA7FF) 100%,
            var(--main-color, #FCA7FF) 100%
        );
    background-size: 100vw 100vw;
    background-attachment: fixed;
}

.detail-page-background::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 0;
}

/* Detail Page Content Container */
.detail-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

.detail-content::after {
    content: "";
    position: fixed;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: var(--detail-image, none) right bottom/contain no-repeat;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

.detail-info {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Detail Page Section Styles */
.detail-section-title {
    color: var(--main-color, #FCA7FF);
    border-bottom: 2px solid var(--main-color, #FCA7FF);
    font-size: 1.5rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.detail-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--main-color, #FCA7FF);
}

.detail-aptitude-badge.a {
    background: var(--main-color, #FCA7FF);
    color: white;
}

.detail-aptitude-badge.b {
    background: var(--main-color, #FCA7FF);
    opacity: 0.5;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-nav {
        gap: 16px;
    }

    .page {
        padding: 20px 16px;
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 18px;
    }

    .detail-page-background {
        padding-left: 16px;
        padding-right: 16px;
    }

    .detail-content {
        padding: 20px 0;
    }

    .footer {
        padding: 20px 16px;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
