/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ベーススタイル */
body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 40px 0;
    overflow: hidden;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    backdrop-filter: blur(10px);
}

.header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.header .container {
    position: relative;
    z-index: 2;
}

.header__title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
    position: relative;
}

.header__title::before {
    content: '⚾';
    position: absolute;
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.header__title::after {
    content: '🏟️';
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    animation: bounce 2s infinite 0.5s;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(-50%); }
    40% { transform: translateY(-60px); }
    60% { transform: translateY(-55px); }
}

.header__subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.05em;
}

/* 目次 */
.toc {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin: 20px 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 600px;
}

.toc__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    text-align: center;
}

.toc__list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.toc__item {
    text-align: center;
}

.toc__link {
    display: block;
    padding: 12px 16px;
    background: linear-gradient(135deg, #42a5f5, #1976d2);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 165, 245, 0.3);
}

.toc__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 165, 245, 0.4);
}

.toc__link--active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.toc__count {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-left: 4px;
}

.toc__note {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-top: 12px;
    font-style: italic;
}

/* 説明テキスト */
.description-text {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.8;
    text-align: center;
    padding: 20px 20px;
    margin: 20px 20px;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.description-text p {
    margin: 0;
}

/* メインコンテンツ */
.main {
    padding: 20px 0;
}

/* エリアセクション */
.area-section {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.area-section__title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 3px solid #42a5f5;
}

.area-section__icon {
    font-size: 1.8rem;
}

/* リーグカード */
.league-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border-left: 5px solid #daeeff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.league-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.league-card__title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.league-card__icon {
    font-size: 1.2rem;
}

.league-card__count {
    font-size: 0.9rem;
    color: #42a5f5;
    font-weight: 600;
    white-space: nowrap;
}

/* アコーディオン */
.university-accordion {
    margin-top: 16px;
}

.university-accordion__toggle {
    width: 100%;
    background: linear-gradient(135deg, #42a5f5, #1976d2);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 165, 245, 0.3);
}

.university-accordion__toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 165, 245, 0.4);
}

.university-accordion__toggle--active {
    background: linear-gradient(135deg, #1976d2, #1565c0);
}

.university-accordion__text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.university-accordion__count {
    font-size: 0.9rem;
    opacity: 0.9;
}

.university-accordion__icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.university-accordion__content {
    display: none;
    background: white;
    border-radius: 0 0 12px 12px;
    margin-top: -4px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 大学リスト */
.university-list__empty {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.university-list__items {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.university-item {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid #42a5f5;
}

.university-item--closed {
    background: #f5f5f5;
    border-left: 4px solid #999;
    opacity: 0.6;
    color: #999;
}

.university-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.university-item__name {
    font-weight: 500;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.university-item__class {
    background: linear-gradient(135deg, #42a5f5, #1976d2);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(66, 165, 245, 0.3);
    vertical-align: baseline;
    display: inline-block;
    line-height: normal;
    height: auto;
}

.university-item__prefecture {
    color: #7f8c8d;
    font-size: 0.85rem;
    font-weight: 400;
}

.university-item__main {
    margin-bottom: 4px;
}

.university-item__player-count {
    color: #5c6bc0;
    font-size: 0.9rem;
    font-weight: 600;
}

.university-item__players {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid #e9ecef;
}

@media (max-width: 768px) {
    .university-item__players {
        font-size: 0.75rem;
    }
}

/* フッター */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 24px 0;
    text-align: center;
    margin-top: 40px;
}

.footer__text {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 30px 0;
    }
    
    .header__title {
        font-size: 1.8rem;
    }
    
    .header__title::before,
    .header__title::after {
        display: none;
    }
    
    .header__subtitle {
        font-size: 1rem;
    }
    
    .toc {
        margin: 16px 20px;
        padding: 20px;
    }
    
    .toc__list {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .toc__link {
        padding: 10px 10px;
        font-size: 0.8rem;
    }
    
    .area-section {
        padding: 24px 20px;
        margin-bottom: 24px;
    }
    
    .area-section__title {
        font-size: 1.6rem;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .league-card {
        padding: 20px;
    }
    
    .league-card__title {
        font-size: 1.2rem;
        flex-direction: row;
        text-align: center;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .league-card__count {
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .university-list__items {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .university-item {
        padding: 12px;
    }
    
    .university-item__name {
        align-items: flex-start;
        gap: 6px;
        font-size: 0.95rem;
    }
    
    .university-item__prefecture {
        font-size: 0.8rem;
    }
    
    .university-item__player-count {
        font-size: 0.85rem;
    }
    
    .university-item__players {
        font-size: 0.75rem;
        margin-top: 6px;
        padding-top: 8px;
    }

    .university-accordion__toggle {
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    .university-accordion__content {
        padding: 16px;
    }

    .team-section {
        padding: 20px 16px;
        margin-bottom: 20px;
    }

    .team-section__title {
        font-size: 1.4rem;
        margin-bottom: 16px;
    }

    .team-list {
        gap: 16px;
    }

    .team-league-section {
        padding: 14px;
    }

    .team-league-section__title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .team-list__items {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .team-item {
        padding: 12px 14px;
        min-height: 44px;
    }

    .team-item__name {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 25px 0;
    }
    
    .header__title {
        font-size: 1.5rem;
    }
    
    .header__subtitle {
        font-size: 0.8rem;
    }
    
    .toc__list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .area-section {
        padding: 20px 16px;
    }
    
    .area-section__title {
        font-size: 1.4rem;
    }
    
    .league-card {
        padding: 16px;
    }
    
    .league-card__title {
        font-size: 1.1rem;
    }

    .team-section {
        padding: 16px 12px;
    }

    .team-section__title {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .team-list {
        gap: 12px;
    }

    .team-league-section {
        padding: 12px;
    }

    .team-league-section__title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .team-list__items {
        gap: 6px;
    }

    .team-item {
        padding: 10px 12px;
        min-height: 40px;
    }

    .team-item__name {
        font-size: 0.85rem;
    }
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.area-section {
    animation: fadeInUp 0.6s ease-out;
}

.league-card {
    animation: fadeInUp 0.6s ease-out;
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #42a5f5, #1976d2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
}

/* トップへ戻るボタン */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.back-to-top:active {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        bottom: 20px;
        right: 20px;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    height: 96vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #1976d2 0%, #42a5f5 50%, #64b5f6 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.8) 0%, rgba(66, 165, 245, 0.8) 50%, rgba(100, 181, 246, 0.8) 100%);
    backdrop-filter: blur(10px);
}

.modal-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: modalHeaderFloat 6s ease-in-out infinite;
}

@keyframes modalHeaderFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.modal-header h2,
.modal-header .close {
    position: relative;
    z-index: 2;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.player-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.player-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #42a5f5;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.player-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.player-item__name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-item__team {
    background: linear-gradient(135deg, #42a5f5, #1976d2);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.player-item__details {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 8px;
}

.player-item__detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.player-item__badges {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.player-item__badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.player-item__badge--development {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #333;
}

.player-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 20px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #42a5f5;
}

.player-item__badge--dropout {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.player-item__badge--retired {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

.university-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.university-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

/* チームセクション */
.team-section {
    margin-top: 30px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease-out;
}

.team-section__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #526b84;
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 2px solid #42a5f5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.team-league-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.team-league-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.team-league-section__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #42a5f5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-list__items {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.team-item {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid #42a5f5;
    display: flex;
    align-items: center;
    min-height: 48px;
}

.team-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(66, 165, 245, 0.2);
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
}

.team-item__link {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.team-item__name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1% auto;
        height: 98vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .player-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .player-item {
        padding: 12px;
    }
    
    .player-item__name {
        font-size: 1rem;
    }
}