:root {
    --primary: #e60012;
    /* JKT48 Red */
    --primary-dark: #b3000e;
    --dark-bg: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --gradient-bg: linear-gradient(135deg, #1a1a1a 0%, #2d1f22 100%);
    --header-blur: rgba(26, 26, 26, 0.8);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Zen Kaku Gothic New', sans-serif;
}

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

body {
    background: var(--gradient-bg);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Nav */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-blur);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -0.05em;
    color: var(--text-main);
}

.logo span {
    color: var(--primary);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-family: var(--font-heading);
    transition: color 0.3s ease;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

/* Hero Section */
.hero {
    margin-top: 80px;
    /* Header height */
    padding: 4rem 2rem;
    text-align: center;
}

.hero h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #999);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Grid Layout */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    /* max-width等の制限を削除し、親またはcontent-containerに任せる */
    width: 100%;
}

/* 新しいコンテンツ幅制限用クラス */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* ... (中略) ... */

/* Group Navigation (Chips) */
.nav-wrapper {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.group-nav {
    display: grid;
    /* ボタンの数に応じて自動折り返し、最小幅を調整 */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.8rem;

    /* コンテンツ幅制限 */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;

    padding: 1.5rem 2rem;
    box-sizing: border-box;
    /* 背景等はWrapperへ移動 */
}

.nav-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    padding: 0.6rem 0;
    text-align: center;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: var(--font-body);
    font-weight: 500;
}

.nav-chip:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.4);
}

.nav-chip:active {
    transform: translateY(0);
}

/* Member Card - Text Focused */
.member-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    height: 100%;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(230, 0, 18, 0.15);
    border-color: rgba(230, 0, 18, 0.3);
}

.card-image {
    display: none;
    /* User requested removal */
}

/* Content Layout */
.card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.member-name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #fff;
    line-height: 1.2;
}

.member-nickname {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.member-details {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.member-details span {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px 0;
}

.member-details span:last-child {
    border-bottom: none;
}

.label {
    opacity: 0.7;
    margin-right: 1rem;
}

.member-remarks {
    display: block !important;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-style: italic;
    color: #888;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 4px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

.status-Regular {
    background: rgba(230, 0, 18, 0.2);
    color: #ff4d5a;
}

.status-Trainee {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.status-Graduate {
    background: rgba(100, 100, 100, 0.2);
    color: #888;
}

.status-Staff {
    background: rgba(0, 120, 255, 0.2);
    color: #4dadff;
}

/* Grouping Headers */
.generation-section {
    grid-column: 1 / -1;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.generation-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #fff;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.social-links {
    margin-top: auto;
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.2s, transform 0.2s;
}

.social-links a:hover {
    color: #fff;
    transform: scale(1.1);
}

.social-links.large a {
    font-size: 1.5rem;
}

/* Footer */
.main-footer {
    margin-top: auto;
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 2rem 1.5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
    padding-left: 0.75rem;
}

.footer-section p,
.footer-section a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    line-height: 1.6;
}

.copyright {
    text-align: center;
    color: #444;
    font-size: 0.8rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.member-card {
    animation: fadeIn 0.5s ease backwards;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav ul {
        gap: 1.5rem;
        font-size: 0.9rem;
    }

    .hero h2 {
        font-size: 2rem;
    }
}

/* Ranking Styles */
.members-grid.ranking-container {
    display: block;
}

.ranking-section {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
    padding: 1.5rem;
    overflow: hidden;
}

.ranking-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.ranking-header h3 {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: background 0.2s;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rank-num {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    width: 40px;
    text-align: center;
    margin-right: 1rem;
    color: var(--text-muted);
}

.rank-1 .rank-num {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    font-size: 1.5rem;
}

.rank-2 .rank-num {
    color: #c0c0c0;
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
    font-size: 1.4rem;
}

.rank-3 .rank-num {
    color: #cd7f32;
    text-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
    font-size: 1.3rem;
}

.rank-name {
    flex-grow: 1;
    font-weight: 600;
    color: #fff;
}

.rank-team {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.rank-val {
    text-align: right;
}

.main-val {
    display: block;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.abbr-val {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.diff-val {
    font-size: 0.8rem;
    font-weight: 600;
}

.diff-val.pos {
    color: #4cd964;
}

.diff-val.neg {
    color: #ff3b30;
}

.growth-rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

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

/* Links Page Styles */
.links-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.link-section {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.link-cat-title {
    font-family: var(--font-heading);
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.link-cat-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.link-item {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.link-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary);
    transform: translateX(5px);
}

.link-title {
    display: block;
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.3rem;
    font-family: var(--font-heading);
}

.link-title i {
    color: var(--text-muted);
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.link-note {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
}