html {
    scroll-behavior: smooth;
}

:root {
    --bg-color: #0b0c10;
    --text-color: #f0f4f8;
    --card-bg: rgba(26, 28, 35, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --main-accent: #00e5ff;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(12px);

    /* メンバーのテーマカラー */
    --wen: #FF8C9B;
    --rito: #FAC31E;
    --ittetsu: #8C4664;
    --mana: #64C8F0;
    --inami: #DCFF50;
    --row: #5A5FAA;
    --shou: #A58CDC;
    --kagetsu: #6EB487;

    font-family: 'Noto Sans JP', sans-serif;
}

[data-theme="light"] {
    --bg-color: #f0f4f8;
    --text-color: #1a1c23;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 18px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(0, 229, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(255, 92, 168, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 1200px;
    width: 100%;
    /* ← 【追加】画面幅を超えないようにする */
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
}

h1,
h2,
h3 {
    margin-bottom: 20px;
    font-weight: 700;
}

.title-glow {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 5px;
    text-shadow: none;
    animation: none;
}

#member-name-display {
    background: none;
    -webkit-text-fill-color: var(--main-accent);
    color: var(--main-accent);
    animation: none;
}



.subtitle {
    text-align: center;
    color: #cbd5e1;
    font-size: 1.5rem;
    margin-bottom: 40px;
}

.stats-note {
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--main-accent, #00e5ff);
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 6px;
    display: inline-block;
    padding: 4px 14px;
    letter-spacing: 0.5px;
}

header:has(.stats-note) {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-left: 4px solid var(--main-accent);
    padding-left: 10px;
    margin: 50px 0 20px;
}

.cyber-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.cyber-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    /* モバイルでの不要なtransformを抑制（PCのみに限定済みだが念のため） */
    transform: translateY(-2px);
}

@media (max-width: 768px) {

    .cyber-card,
    .table-wrapper {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(26, 28, 35, 0.95) !important;
        box-shadow: none !important;
    }

    [data-theme="light"] .cyber-card,
    [data-theme="light"] .table-wrapper {
        background: rgba(255, 255, 255, 0.95) !important;
    }

    .fab-container {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .cyber-card:hover {
        transform: none !important;
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    /* JS (app.js) の display: none 制御を受け付けるため inline-style は不使用 */
}

@keyframes gaming-gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes gaming-glow {

    0%,
    100% {
        text-shadow: 0 0 10px var(--wen), 0 0 20px var(--wen);
    }

    12.5% {
        text-shadow: 0 0 10px var(--rito), 0 0 20px var(--rito);
    }

    25% {
        text-shadow: 0 0 10px var(--ittetsu), 0 0 20px var(--ittetsu);
    }

    37.5% {
        text-shadow: 0 0 10px var(--mana), 0 0 20px var(--mana);
    }

    50% {
        text-shadow: 0 0 10px var(--inami), 0 0 20px var(--inami);
    }

    62.5% {
        text-shadow: 0 0 10px var(--row), 0 0 20px var(--row);
    }

    75% {
        text-shadow: 0 0 10px var(--shou), 0 0 20px var(--shou);
    }

    87.5% {
        text-shadow: 0 0 10px var(--kagetsu), 0 0 20px var(--kagetsu);
    }
}

@keyframes scan-color {

    0%,
    100% {
        background: var(--wen);
        box-shadow: 0 0 8px var(--wen);
    }

    12.5% {
        background: var(--rito);
        box-shadow: 0 0 8px var(--rito);
    }

    25% {
        background: var(--ittetsu);
        box-shadow: 0 0 8px var(--ittetsu);
    }

    37.5% {
        background: var(--mana);
        box-shadow: 0 0 8px var(--mana);
    }

    50% {
        background: var(--inami);
        box-shadow: 0 0 8px var(--inami);
    }

    62.5% {
        background: var(--row);
        box-shadow: 0 0 8px var(--row);
    }

    75% {
        background: var(--shou);
        box-shadow: 0 0 8px var(--shou);
    }

    87.5% {
        background: var(--kagetsu);
        box-shadow: 0 0 8px var(--kagetsu);
    }
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 8px;
    background: linear-gradient(90deg,
            var(--wen),
            var(--rito),
            var(--ittetsu),
            var(--mana),
            var(--inami),
            var(--row),
            var(--shou),
            var(--kagetsu),
            var(--wen));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation:
        gaming-gradient 3s linear infinite,
        gaming-glow 6s linear infinite;
    display: flex;
    align-items: center;
    gap: 15px;
}

.loading-text::after {
    content: '';
    width: 30px;
    height: 3px;
    border-radius: 2px;
    animation:
        scan 1.5s ease-in-out infinite,
        scan-color 6s linear infinite;
}

@keyframes scan {

    0%,
    100% {
        width: 0;
        opacity: 0;
    }

    50% {
        width: 50px;
        opacity: 1;
    }
}

.recommend-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.recommend-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.05) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.card-content {
    position: relative;
    z-index: 1;
}

.song-title {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 15px;
}

.song-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    color: #a0aabf;
    font-size: 0.95rem;
}

.song-details span {
    color: var(--main-accent);
    font-weight: 600;
}

/* ========== 新着楽曲カルーセル ========== */
.new-songs-carousel {
    overflow: hidden;
    position: relative;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
    padding: 0 4px;
}

.new-song-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.new-song-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.05) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.new-song-card > * {
    position: relative;
    z-index: 1;
}

.new-song-date {
    font-size: 0.8rem;
    color: var(--main-accent);
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.new-song-title {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 12px;
}

[data-theme="light"] .new-song-title {
    color: var(--text-color);
}

.new-song-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    color: #a0aabf;
    font-size: 0.9rem;
}

[data-theme="light"] .new-song-meta {
    color: #6b7280;
}

.new-song-meta .meta-label {
    color: var(--main-accent);
    font-weight: 600;
}

.new-song-play {
    font-size: 0.85rem;
    padding: 8px 20px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--main-accent);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot.active {
    background: var(--main-accent);
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: rgba(0, 229, 255, 0.4);
}

@media (max-width: 768px) {
    .new-song-title {
        font-size: 1.15rem;
    }

    .new-song-meta {
        flex-direction: column;
        gap: 4px;
        font-size: 0.85rem;
    }

    .new-song-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(26, 28, 35, 0.95) !important;
        box-shadow: none !important;
    }

    [data-theme="light"] .new-song-card {
        background: rgba(255, 255, 255, 0.95) !important;
    }

    .new-song-card:hover {
        transform: none !important;
    }
}

.cyber-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--main-accent);
    border: 1px solid var(--main-accent);
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cyber-button svg {
    pointer-events: none;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
}

.cyber-button:hover {
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.4);
    transform: translateY(-2px);
    background: rgba(0, 229, 255, 0.1);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.cyber-button:active {
    transform: translateY(0);
}

.cyber-button.small {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 4px;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 15px;
    /* 見出しとの間隔を少し調整 */
}

/* ユニットごとのグループ化用スタイル */
.unit-group {
    margin-top: 30px;
    margin-bottom: 40px;
}

.unit-label {
    display: flex;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-align: left;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.unit-label::after {
    content: '';
    flex: 1;
    height: 1px;
    margin-left: 15px;
    background: rgba(255, 255, 255, 0.1);
}

/* 暖色系発光 (Oriens) - よりオレンジ寄りに */
.oriens-label {
    color: #ff9d5c;
    text-shadow: 0 0 10px rgba(255, 120, 50, 0.7);
}

.unit-label.oriens-label::after {
    background: linear-gradient(to right, rgba(255, 120, 50, 0.4), transparent);
}

/* 冷色系発光 (Dytica) - より青寄りに */
.dytica-label {
    color: #8c9eff;
    text-shadow: 0 0 10px rgba(50, 150, 255, 0.7);
}

.unit-label.dytica-label::after {
    background: linear-gradient(to right, rgba(50, 150, 255, 0.4), transparent);
}

/* --- Member Cards --- */
.member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-left: 3px solid var(--member-color);
}

.member-card-name {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

.member-card-count {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-top: 4px;
    font-family: 'Montserrat', sans-serif;
}

.member-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--member-color), transparent);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

/* 強調表示 */
.text-highlight {
    color: var(--main-accent) !important;
    font-size: 1.1em;
    font-weight: 800;
}

[data-theme="light"] .member-card {
    color: #1e293b;
}

/* PC向けのホバーのみに限定 */
@media (hover: hover) {
    .member-card:hover {
        border-color: var(--member-color);
        background: color-mix(in srgb, var(--member-color) 10%, var(--card-bg));
        transform: translateY(-2px);
        box-shadow: 0 4px 20px color-mix(in srgb, var(--member-color) 25%, transparent),
                    0 0 40px color-mix(in srgb, var(--member-color) 10%, transparent);
    }

    .member-card:hover::after {
        opacity: 1;
    }
}

/* スマホ等でタップ中の状態 */
.member-card.is-tapping,
.member-card:active {
    background: color-mix(in srgb, var(--member-color) 12%, var(--card-bg)) !important;
    border-color: var(--member-color) !important;
}

.sns-links-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

/* 検索ヒーローセクション */
.search-hero-section {
    margin-bottom: 40px;
    text-align: center;
}

.search-hero-container {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 20px auto 40px;
}

.hero-search-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    flex: 1;
    width: 100%;
}

.search-input-wrapper .search-box {
    width: 100%;
    padding-right: 40px;
}

#search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--main-accent);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#search-clear-btn:hover {
    text-shadow: 0 0 10px var(--main-accent), 0 0 20px var(--main-accent);
}

.hero-search-btn {
    padding: 10px 30px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .search-hero-container {
        flex-direction: column;
    }

    .hero-search-btn {
        width: 100%;
    }
}

.sns-link-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
    border-color: var(--border-color);
    color: #e0e6ed;
}

.sns-link-btn:hover {
    background: var(--main-accent);
    color: #000;
    border-color: var(--main-accent);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.notes-section {
    margin-top: 60px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #555;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: #8b92a5;
}

.notes-section p {
    margin-bottom: 8px;
}

.thanks-text {
    margin-top: 15px;
    color: #d0d6e0;
    font-weight: 600;
}

.controls-container {
    position: sticky;
    top: 0;
    margin: 0 -20px;
    padding: 15px 20px;
    background-color: var(--bg-color);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
}

.no-sticky {
    position: relative !important;
    top: auto !important;
    box-shadow: none !important;
    border-bottom: none !important;
    margin: 0 !important;
    padding: 15px 0 !important;
    background: transparent !important;
    z-index: auto !important;
    display: block !important;
}

.controls-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.search-box {
    flex: 1;
    min-width: 250px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 16px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-box:focus {
    border-color: var(--main-accent);
}

.sort-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-btn:hover {
    border-color: var(--main-accent);
    color: var(--main-accent);
}

.year-filter-select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: border-color 0.3s;
    appearance: auto;
}

.year-filter-select:hover,
.year-filter-select:focus {
    border-color: var(--main-accent);
    outline: none;
}

.fav-manage-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.table-wrapper {
    width: 100%;
    /* ← 【追加】テーブルが親要素を突き破らないようにする */
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: var(--glass-blur);
    -webkit-overflow-scrolling: touch;
    position: relative;
    /* スクロールヒント用 */
}

/* スクロールヒント用のアニメーションとスタイル */
.scroll-hint {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(11, 12, 16, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 10;
}

.scroll-hint.visible {
    opacity: 1;
}

.scroll-hint span {
    color: var(--main-accent);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    animation: scroll-pulse 1.5s infinite;
}

@keyframes scroll-pulse {

    0%,
    100% {
        opacity: 0.5;
        text-shadow: none;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px var(--main-accent);
    }
}

.cyber-table {
    width: 100%;
    border-collapse: collapse;
    /* 大きな最小幅を削除し、スマホ画面でも無理なく縮むようにする */
}

.cyber-table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--main-accent);
    font-size: 1.3rem;
    /* 項目名を大きく調整 */
    font-weight: 700;
    /* 太字に設定 */
    letter-spacing: 1px;
    white-space: nowrap;
    text-align: left;
    /* 項目名を左寄せに変更 */
    padding: 16px 12px;
}

.cyber-table td {
    padding: 16px 12px;
    font-size: 1.1rem;
    text-align: left;
    /* データは左寄せ */
    border-bottom: 1px solid var(--border-color);
}

/* 偶数行の背景を薄くして視認性アップ（ゼブラストライプ） */
.cyber-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .cyber-table tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.03);
}

.cyber-table tr:hover td {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .cyber-table tr:hover td {
    background: rgba(0, 0, 0, 0.05);
}

.cyber-table tr.is-favorite-row td {
    background: rgba(250, 195, 30, 0.05);
    /* ゴールド(rito)の薄い背景色 */
}

.col-fav {
    width: 60px;
    min-width: 60px;
    text-align: left;
    /* お気に入り列では左寄せ */
}

/* お気に入りボタン */
.fav-btn {
    background: transparent;
    border: none;
    color: #8b92a5;
    cursor: pointer;
    padding: 8px;
    /* タップしやすく */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease, filter 0.2s ease;
}

.fav-btn:hover {
    transform: scale(1.2);
    color: #a0aabf;
}

.fav-btn.is-favorite {
    color: #FAC31E;
    /* ゴールド */
    filter: drop-shadow(0 0 5px #FAC31E);
}

.fav-btn.is-favorite svg {
    fill: #FAC31E;
}

/* マイクロインタラクション用アニメーション */
@keyframes star-pop {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px #FAC31E);
    }

    50% {
        transform: scale(1.6);
        filter: drop-shadow(0 0 15px #FAC31E);
    }

    100% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 5px #FAC31E);
    }
}

.fav-btn.pop-animation {
    animation: star-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fav-fab-glow {
    0% {
        box-shadow: 0 4px 20px rgba(0, 229, 255, 0.4);
        border-color: var(--main-accent);
    }

    20% {
        box-shadow: 0 0 30px #FAC31E, 0 0 10px #FAC31E inset;
        border-color: #FAC31E;
        color: #FAC31E;
    }

    80% {
        box-shadow: 0 0 30px #FAC31E, 0 0 10px #FAC31E inset;
        border-color: #FAC31E;
        color: #FAC31E;
    }

    100% {
        box-shadow: 0 4px 20px rgba(0, 229, 255, 0.4);
        border-color: var(--main-accent);
    }
}

.fab-btn.fav-fab.glow-animation {
    animation: fav-fab-glow 0.8s ease-out;
}

.col-date {
    width: 120px;
    min-width: 120px;
    font-size: 0.9rem;
    white-space: nowrap;
}

td.col-date {
    color: #a0aabf;
}

.col-title {
    width: 300px;
    min-width: 300px;
    word-break: break-word;
}

td.col-title {
    font-weight: 600;
    color: #fff;
}

.title-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, 0.2);
    transition: color 0.2s, text-shadow 0.2s, text-decoration-color 0.2s;
    display: inline-block;
}

.title-link:hover {
    color: var(--main-accent);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
    text-decoration-color: var(--main-accent);
}

.col-artist {
    width: 200px;
    min-width: 200px;
    word-break: break-word;
}

td.col-artist {
    color: #e2e8f0;
}

.col-singer {
    width: 200px;
    min-width: 200px;
    word-break: break-word;
}

td.col-singer {
    color: #e2e8f0;
}

.col-video-title {
    width: 300px;
    min-width: 300px;
    word-break: break-word;
}

td.col-video-title {
    color: #e2e8f0;
    font-size: 0.85rem;
}

.col-action {
    width: 80px;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

/* PC向け データーベーステーブル表示の最適化 */
@media (min-width: 1025px) {
    .table-wrapper {
        overflow-x: hidden;
    }

    .cyber-table {
        table-layout: fixed;
    }

    .cyber-table td,
    .cyber-table th {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .col-fav {
        width: 5%;
        min-width: 45px;
    }

    .col-date {
        width: 10%;
        min-width: 100px;
    }

    .col-title {
        width: 30%;
        min-width: 0;
    }

    .col-singer {
        width: 15%;
        min-width: 0;
    }

    .col-artist {
        width: 15%;
        min-width: 0;
    }

    .col-video-title {
        width: 25%;
        min-width: 0;
    }
}

.table-link-btn {
    display: inline-block;
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--main-accent);
    color: var(--main-accent);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 1rem;
    /* ← 【変更】ボタンの文字を大きく */
    padding: 10px 24px;
    /* ← 【変更】縮小されても指で押しやすいサイズに拡大 */
}

.table-link-btn:hover {
    background: var(--main-accent);
    color: #000;
}

.page-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer-inquiry {
    margin-bottom: 20px;
    color: #a0aabf;
    font-size: 0.95rem;
}

.footer-link {
    color: var(--main-accent);
    text-decoration: none;
    margin-left: 10px;
}

.footer-link:hover {
    text-decoration: underline;
}



.song-count {
    text-align: right;
    margin-top: 5px;
    color: #8b92a5;
    font-size: 0.9rem;
    font-weight: 600;
}

.song-count span {
    color: var(--main-accent);
    font-size: 1.1rem;
    margin: 0 4px;
}

/* ▼ About / Attention / Special Thanks のフォントサイズ調整 ▼ */

/* About（サイト説明）のテキスト */
.subtitle {
    font-size: 0.85rem;
}

/* About内のさらに小さい注記（※個人で制作〜 の部分） */
.subtitle small {
    font-size: 0.75rem;
}

/* Attention と Special Thanks, About のテキストを 0.85rem に統一 */
section p,
.cyber-card p {
    font-size: 0.85rem;
    color: #e2e8f0;
    /* メインコンテンツより少しだけ暗い色にしてメリハリをつける */
    margin-bottom: 8px;
    /* 行同士の隙間を少し詰めてまとまりを出す */
    text-align: justify;
    /* 文章の端を綺麗に揃える */
}

/* ※おすすめ楽曲カード内のテキストが小さくならないように保護 */
.recommend-card p {
    font-size: 0.95rem;
    color: #e0e6ed;
}

@media (max-width: 768px) {

    html,
    body {
        overflow-x: clip;
        width: 100%;
    }

    .container {
        padding: 24px 12px;
        /* サイド余白を縮小して画面を有効活用 */
        padding-bottom: 90px;
        /* FAB領域を確保 */
    }

    .title-glow {
        font-size: 2.6rem;
        line-height: 1.1;
        word-break: break-word;
        white-space: normal;
        letter-spacing: 1px;
    }

    .song-title {
        font-size: 1.4rem;
        line-height: 1.4;
        word-break: break-word;
        white-space: normal;
        margin-bottom: 10px;
    }

    .song-details {
        flex-direction: column;
        gap: 5px;
    }

    .members-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .member-card {
        padding: 16px 10px 12px;
        min-height: 70px;
    }

    /* ==== 検索・フィルタ エリアのモバイル最適化 ==== */

    /* 検索ボックスを大きく、タップしやすく */
    .search-hero-container {
        margin: 12px auto 20px;
    }

    .search-box {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
        padding: 12px 40px 12px 14px;
        border-radius: 10px;
    }

    /* コントロールバーをstickyにして常にアクセス可能 */
    /* モバイルではフィルターをstickyにして常にアクセス可能 */
    .controls-container {
        position: sticky !important;
        top: 0 !important;
        margin: 0 -12px !important;
        padding: 8px 12px !important;
        z-index: 1000 !important;
        background-color: var(--bg-color) !important;
        border-bottom: 1px solid var(--border-color) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
        display: block !important;
    }

    .controls-inner {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        padding: 0;
    }

    /* フィルターのセレクトをコンパクトに横並び */
    .year-filter-select {
        min-height: 40px;
        font-size: 0.85rem;
        padding: 6px 10px;
        flex: 1;
        min-width: 0;
        border-radius: 8px;
    }

    .sort-btn {
        width: auto;
        min-height: 40px;
        font-size: 0.8rem;
        padding: 6px 12px;
        white-space: nowrap;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .song-count {
        margin-top: 8px;
        font-size: 0.8rem;
    }

    /* ==== テーブルのモバイル対応 ==== */
    .cyber-table {
        table-layout: auto;
        width: 100%;
    }

    .cyber-table th,
    .cyber-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
        white-space: normal;
    }

    .col-date {
        width: 80px;
        min-width: 80px;
    }

    .col-title {
        width: 150px;
        min-width: 150px;
    }

    .col-singer {
        width: 120px;
        min-width: 120px;
    }

    .col-artist {
        width: 180px;
        min-width: 180px;
    }

    /* ==== FAV ★ ボタンのタップエリア拡大 ==== */
    .col-fav {
        width: 48px;
        min-width: 48px;
    }

    .fav-btn {
        padding: 10px;
        /* タッチターゲット44px以上を確保 */
    }

    .fav-btn svg {
        width: 22px;
        height: 22px;
    }

    .mobile-break {
        display: block;
        margin-top: 5px;
    }
}

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

/* 浮遊ナビゲーションボタン (FAB) */
.fab-container {
    position: fixed;
    right: 25px;
    bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.fab-container.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* モバイルではFABバーを常時表示 */
@media (max-width: 768px) {
    .fab-container {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }
}

.fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--main-accent);
    color: var(--main-accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.4);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.fab-btn svg {
    margin-bottom: 2px;
}

.fab-btn:hover {
    background: var(--main-accent);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    /* FABを画面下部の横並びバーに変更 - 片手操作に最適化 */
    .fab-container {
        right: 0;
        left: 0;
        bottom: 0;
        flex-direction: row;
        justify-content: center;
        gap: 0;
        background: var(--bg-color);
        border-top: 1px solid var(--border-color);
        padding: 6px 8px;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
        /* iPhone SafeArea対応 */
    }

    .fab-btn {
        width: auto;
        height: auto;
        min-width: 56px;
        min-height: 44px;
        border-radius: 10px;
        font-size: 0.6rem;
        padding: 4px 12px;
        border: none;
        box-shadow: none;
        background: transparent;
        flex: 1;
        max-width: 80px;
        gap: 2px;
    }

    .fab-btn svg {
        width: 20px;
        height: 20px;
    }

    .fab-btn:hover {
        background: rgba(0, 229, 255, 0.1);
        box-shadow: none;
        transform: none;
    }

    .fab-btn:active {
        background: rgba(0, 229, 255, 0.2);
    }

    [data-theme="light"] .fab-btn {
        background: transparent;
    }

    [data-theme="light"] .fab-btn:hover,
    [data-theme="light"] .fab-btn:active {
        background: rgba(0, 118, 163, 0.1);
    }
}

/* ==========================================================
   お気に入りモード（fav-mode）の専用スタイル - コンパクト表示
========================================================== */
body.fav-mode .col-fav {
    width: 40px !important;
    min-width: 40px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    text-align: center !important;
}

body.fav-mode .fav-btn {
    padding: 4px;
    margin: 0 auto;
}

body.fav-mode .cyber-table th,
body.fav-mode .cyber-table td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    font-size: 0.95rem;
    /* スマホやPCでの一覧性を高めるため少し文字を縮小 */
}

body.fav-mode .cyber-table th {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

body.fav-mode .cyber-table th.col-fav {
    color: var(--main-accent);
    font-size: 1.2rem;
}

/* ==========================================================
   サイバー風モーダル（ポップアップ）
========================================================== */
.cyber-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.85);
    /* 半透明な暗い背景 */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cyber-modal-overlay.show {
    opacity: 1;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cyber-modal-overlay.show .modal-content {
    transform: scale(1);
}

/* --- THEME TOGGLE & HEADER ADJUSTMENTS --- */
.main-header {
    position: relative;
    padding-top: 40px;
}

.theme-toggle-container {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 100;
}

.theme-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    user-select: none;
    transition: background 0.3s;
}

.theme-label {
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 16px;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.5);
}

.theme-label.active {
    background: var(--main-accent);
    color: #000;
}

.header-site-type {
    text-align: center;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.attention-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 15px 0;
}

[data-theme="light"] {
    --bg-color: #f0f4f8;
    --text-color: #1a1c23;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
    --main-accent: #0076a3;
    /* 少し暗くしたシアン */
}

[data-theme="light"] body {
    background-image:
        radial-gradient(circle at 15% 50%, rgba(0, 118, 163, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(255, 92, 168, 0.05) 0%, transparent 50%);
}

[data-theme="light"] .cyber-button:hover {
    background: #0076a3;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 118, 163, 0.3);
}

[data-theme="light"] .secondary-btn {
    background: #e2e8f0;
    color: #334155;
    border-color: #cbd5e1;
}

[data-theme="light"] .secondary-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .theme-label {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .theme-label.active {
    background: var(--main-accent);
    color: #fff;
}

[data-theme="light"] .header-site-type,
[data-theme="light"] .subtitle {
    color: #64748b;
}

[data-theme="light"] .stats-note {
    color: #0077b6;
    background: rgba(0, 119, 182, 0.08);
    border-color: rgba(0, 119, 182, 0.25);
}

[data-theme="light"] .title-glow {
    color: #0f172a;
    text-shadow: none;
}

[data-theme="light"] .cyber-table th {
    background: color-mix(in srgb, var(--main-accent) 15%, rgba(0, 0, 0, 0.05));
    color: color-mix(in srgb, var(--main-accent) 70%, #000) !important;
}

@supports not (color: color-mix(in srgb, red, blue)) {
    [data-theme="light"] .cyber-table th {
        background: rgba(0, 0, 0, 0.05);
        color: #1e293b !important;
    }
}

[data-theme="light"] .cyber-table tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .cyber-table tr:hover td {
    background: rgba(0, 0, 0, 0.04);
}

/* member-btn legacy removed - see .member-card */

[data-theme="light"] .song-title {
    color: #0f172a;
}

[data-theme="light"] .title-link {
    color: #1a1c23;
}

[data-theme="light"] .title-link:hover {
    color: var(--main-accent);
}

[data-theme="light"] td.col-artist,
[data-theme="light"] td.col-singer,
[data-theme="light"] td.col-video-title,
[data-theme="light"] td.col-date {
    color: #475569;
}

[data-theme="light"] .song-details {
    color: #475569;
}

[data-theme="light"] section p,
[data-theme="light"] .cyber-card p {
    color: #334155;
}

/* メンバーページのタイトル（名前）とPROFILEボタン、楽曲数ハイライトをダークトーンの同系色に見やすく調整 */
[data-theme="light"] #member-name-display,
[data-theme="light"] .sns-link-btn,
[data-theme="light"] .song-count span {
    color: color-mix(in srgb, var(--main-accent) 40%, #000) !important;
}

/* 楽曲数 テキスト自体の可読性向上 */
[data-theme="light"] .song-count {
    color: #475569;
}

/* PROFILEボタン自体の背景と枠線をライトモード向けに調整 */
[data-theme="light"] .sns-link-btn {
    background: color-mix(in srgb, var(--main-accent) 10%, transparent);
    border-color: color-mix(in srgb, var(--main-accent) 40%, transparent);
}

[data-theme="light"] .sns-link-btn:hover {
    background: color-mix(in srgb, var(--main-accent) 20%, transparent);
    color: #fff !important;
}

@supports not (color: color-mix(in srgb, red, blue)) {

    [data-theme="light"] #member-name-display,
    [data-theme="light"] .sns-link-btn,
    [data-theme="light"] .song-count span {
        color: #1e293b !important;
    }
}

[data-theme="light"] .unit-label {
    color: #1e293b;
}

[data-theme="light"] .dytica-label {
    color: #3b5bdb;
    /* ダークブルーで可読性UP */
    text-shadow: none;
}

[data-theme="light"] .unit-label.dytica-label::after {
    background: linear-gradient(to right, rgba(59, 91, 219, 0.4), transparent);
}

[data-theme="light"] .oriens-label {
    color: #e85d04;
    /* 見やすいオレンジ */
    text-shadow: none;
}

[data-theme="light"] .unit-label.oriens-label::after {
    background: linear-gradient(to right, rgba(232, 93, 4, 0.4), transparent);
}

[data-theme="light"] .search-box {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .search-box::placeholder {
    color: #94a3b8;
}

[data-theme="light"] .sort-btn {
    color: #1e293b;
}

[data-theme="light"] .fab-btn {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .loading-overlay {
    background: #f0f4f8;
}

[data-theme="light"] .cyber-button:hover {
    color: #fff;
}

/* ==============================
   Stats Page Styles
   ============================== */

/* --- Stats TOC (Table of Contents) --- */
.stats-toc {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-color);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-toc-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.2s;
    white-space: nowrap;
}

.stats-toc-item:hover {
    border-color: var(--main-accent);
    color: var(--main-accent);
    background: rgba(0, 229, 255, 0.08);
}

.stats-toc-item svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.stats-toc-item:hover svg {
    opacity: 1;
}

#dashboard-section,
#overlap-section,
#calendar-section,
#artist-ranking-section {
    scroll-margin-top: 60px;
}

@media (max-width: 768px) {
    .stats-toc {
        gap: 6px;
        padding: 10px 0;
    }

    .stats-toc-item {
        padding: 6px 12px;
        font-size: 0.7rem;
    }

    .stats-toc-item svg {
        width: 14px;
        height: 14px;
    }

    #dashboard-section,
    #overlap-section,
    #calendar-section,
    #artist-ranking-section {
        scroll-margin-top: 50px;
    }

    .ranking-bar-track {
        display: none;
    }
}

.stats-subtitle {
    font-family: 'Montserrat', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--main-accent);
}

.stats-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats-select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-color);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    min-width: 150px;
}

.stats-select:focus {
    border-color: var(--main-accent);
}

/* --- Member Bar Chart (Feature 14) --- */
.member-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-member-name {
    width: 100px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.stat-member-name:hover {
    opacity: 0.7;
}

.stat-bar-track {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

[data-theme="light"] .stat-bar-track {
    background: rgba(0, 0, 0, 0.06);
}

.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
    opacity: 0.85;
}

.stat-bar-count {
    width: 40px;
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* --- Monthly Activity Chart --- */
.monthly-chart-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.monthly-chart-container {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    min-height: 180px;
    padding-top: 10px;
    min-width: max-content;
}

.monthly-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 32px;
    flex-shrink: 0;
}

.bar-fill-wrapper {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: flex-end;
}

.bar-fill {
    width: 100%;
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease;
    min-height: 1px;
}

.bar-count {
    font-size: 0.65rem;
    margin-top: 2px;
    opacity: 0.7;
    height: 14px;
}

.bar-label {
    font-size: 0.6rem;
    opacity: 0.5;
    white-space: pre-line;
    text-align: center;
    line-height: 1.2;
    height: 28px;
}

/* --- Member Stats Grid (Cards) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.member-stat-card {
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
    padding: 20px 16px;
    border-top: 3px solid var(--card-accent);
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s;
}

.member-stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-accent);
}

.member-stat-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.member-stat-total {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
}

.member-stat-unit {
    font-size: 0.7rem;
    font-weight: 400;
    margin-left: 4px;
    opacity: 0.6;
}

.member-stat-artists {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
    min-height: 48px;
}

.top-artist-item {
    font-size: 0.75rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-stat-date {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* --- Overlap Map (Feature 9) --- */
.overlap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 12px;
    overflow: hidden;
}

.overlap-card {
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.overlap-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.overlap-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.overlap-member-count {
    font-size: 0.8rem;
    color: var(--main-accent);
    font-weight: 700;
}

.overlap-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.member-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #000;
    white-space: nowrap;
}

.member-badge.small {
    padding: 1px 6px;
    font-size: 0.65rem;
}

.overlap-versions {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.overlap-card.expanded .overlap-versions {
    max-height: 500px;
}

.overlap-version {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.overlap-date {
    opacity: 0.6;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.overlap-singer-full {
    opacity: 0.5;
    font-size: 0.7rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overlap-play-link {
    color: var(--main-accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.overlap-play-link:hover {
    text-decoration: underline;
}

/* --- Heatmap Calendar (Feature 12) --- */
.heatmap-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
}

.heatmap-outer {
    display: flex;
    gap: 4px;
    min-width: max-content;
}

.heatmap-day-labels {
    display: grid;
    grid-template-rows: repeat(7, 13px);
    gap: 2px;
    font-size: 0.6rem;
    opacity: 0.5;
    text-align: right;
    padding-right: 4px;
}

.heatmap-day-labels span {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 13px;
}

.heatmap-month-labels {
    position: relative;
    height: 16px;
    font-size: 0.65rem;
    opacity: 0.5;
    margin-bottom: 2px;
    margin-left: 28px;
    min-width: max-content;
}

.heatmap-month-labels span {
    white-space: nowrap;
    position: absolute;
}

.heatmap-container {
    display: grid;
    grid-template-rows: repeat(7, 13px);
    grid-auto-flow: column;
    grid-auto-columns: 13px;
    gap: 2px;
}

.heatmap-cell {
    width: 13px;
    height: 13px;
    border-radius: 2px;
    cursor: pointer;
    transition: outline 0.1s;
}

.heatmap-cell:hover {
    outline: 2px solid var(--text-color);
    outline-offset: -1px;
}

.heatmap-cell.level-out {
    background: transparent;
    cursor: default;
}

.heatmap-cell.level-out:hover {
    outline: none;
}

.heatmap-cell.level-0 {
    background: rgba(255, 255, 255, 0.06);
}

.heatmap-cell.level-1 {
    background: rgba(0, 229, 255, 0.2);
}

.heatmap-cell.level-2 {
    background: rgba(0, 229, 255, 0.4);
}

.heatmap-cell.level-3 {
    background: rgba(0, 229, 255, 0.65);
}

.heatmap-cell.level-4 {
    background: rgba(0, 229, 255, 0.9);
}

[data-theme="light"] .heatmap-cell.level-0 {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .heatmap-cell.level-1 {
    background: rgba(0, 118, 163, 0.2);
}

[data-theme="light"] .heatmap-cell.level-2 {
    background: rgba(0, 118, 163, 0.4);
}

[data-theme="light"] .heatmap-cell.level-3 {
    background: rgba(0, 118, 163, 0.65);
}

[data-theme="light"] .heatmap-cell.level-4 {
    background: rgba(0, 118, 163, 0.9);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 8px;
}

.heatmap-legend .heatmap-cell {
    width: 13px;
    height: 13px;
    cursor: default;
}

.heatmap-legend .heatmap-cell:hover {
    outline: none;
}

/* --- Stats Hub Cards --- */
.stats-hub-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 900px;
    margin: 0 auto;
}

/* PC5列では不要 */
.stats-hub-grid .stats-hub-card:last-child {
    grid-column: auto;
}

.stats-hub-card {
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
    padding: 16px 10px;
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s;
    border-top: 2px solid var(--main-accent);
}

.stats-hub-card:hover {
    transform: translateY(-3px);
}

.stats-hub-icon {
    margin-bottom: 6px;
    color: var(--main-accent);
}

.stats-hub-icon svg {
    width: 24px;
    height: 24px;
}

.stats-hub-title {
    font-family: 'Montserrat', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.stats-hub-desc {
    font-size: 0.7rem;
    opacity: 0.6;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .stats-hub-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* モバイル: 5番目のカードを1カラム幅で中央に */
    .stats-hub-grid .stats-hub-card:last-child {
        grid-column: 1 / 2;
        max-width: none;
        justify-self: stretch;
    }

    .stats-hub-card {
        padding: 12px 8px;
    }
}

/* --- Monthly Calendar Grid --- */
/* カレンダーナビゲーション */
.cal-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cal-nav-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.cal-nav-btn:hover {
    background: var(--main-accent);
    color: #000;
    border-color: var(--main-accent);
}

.cal-nav-label {
    font-family: 'Montserrat', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    min-width: 120px;
    text-align: center;
}

.calendar-single-month {
    max-width: 500px;
    margin: 20px auto 0;
}

.calendar-single-month .cal-month-card {
    padding: 20px;
}

.calendar-single-month .cal-day {
    min-height: 44px;
}

.calendar-single-month .cal-day-num {
    font-size: 0.85rem;
}

.calendar-single-month .cal-day-count {
    font-size: 0.65rem;
}

.calendar-monthly-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.cal-month-card {
    padding: 16px;
}

.cal-month-card:hover {
    transform: none;
}

.cal-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cal-month-name {
    font-family: 'Montserrat', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--main-accent);
}

.cal-month-total {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.6;
}

.cal-day-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.6rem;
    opacity: 0.4;
    margin-bottom: 4px;
    font-weight: 700;
}

.cal-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: outline 0.1s;
    min-height: 32px;
}

.cal-day.empty {
    cursor: default;
}

.cal-day:not(.empty):hover {
    outline: 2px solid var(--main-accent);
    outline-offset: -1px;
}

.cal-day-num {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

.cal-day-count {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--main-accent);
    line-height: 1;
    margin-top: 1px;
}

.cal-day.level-0 {
    background: rgba(255, 255, 255, 0.03);
}

.cal-day.level-1 {
    background: rgba(0, 229, 255, 0.12);
}

.cal-day.level-2 {
    background: rgba(0, 229, 255, 0.25);
}

.cal-day.level-3 {
    background: rgba(0, 229, 255, 0.4);
}

.cal-day.level-4 {
    background: rgba(0, 229, 255, 0.6);
}

[data-theme="light"] .cal-day.level-0 {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .cal-day.level-1 {
    background: rgba(0, 118, 163, 0.1);
}

[data-theme="light"] .cal-day.level-2 {
    background: rgba(0, 118, 163, 0.2);
}

[data-theme="light"] .cal-day.level-3 {
    background: rgba(0, 118, 163, 0.35);
}

[data-theme="light"] .cal-day.level-4 {
    background: rgba(0, 118, 163, 0.5);
}

@media (max-width: 1024px) {
    .calendar-monthly-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .cal-month-card {
        padding: 12px;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(26, 28, 35, 0.95) !important;
        box-shadow: none !important;
    }

    [data-theme="light"] .cal-month-card {
        background: rgba(255, 255, 255, 0.95) !important;
    }
}

/* --- Overlap Member Link --- */
.overlap-member-link {
    text-decoration: none;
    color: #000;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.overlap-member-link:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.calendar-song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.calendar-song-item:last-child {
    border-bottom: none;
}

.calendar-song-meta {
    font-size: 0.8rem;
    opacity: 0.6;
}

.calendar-stream-group {
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
}

.calendar-stream-group:last-child {
    border-bottom: none;
}

.calendar-stream-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.calendar-stream-songs {
    padding-left: 16px;
    border-left: 2px solid var(--main-accent);
    margin-left: 4px;
}

.calendar-stream-song-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
    flex-wrap: wrap;
}

.calendar-stream-song-name {
    font-size: 0.85rem;
}

/* --- Artist Ranking (Feature 13) --- */
.ranking-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.ranking-position {
    width: 28px;
    text-align: right;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--main-accent);
    flex-shrink: 0;
}

.ranking-name {
    width: 150px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.ranking-name:hover {
    color: var(--main-accent);
}

.ranking-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.ranking-info .ranking-name {
    width: 100%;
    display: block;
    white-space: normal;
}

.ranking-artist-sub {
    display: block;
    font-size: 0.7rem;
    opacity: 0.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.ranking-song-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ranking-song-info .ranking-name {
    width: auto;
    flex-shrink: 0;
}

.ranking-song-info .ranking-artist-sub {
    flex: 1;
    min-width: 0;
}

.ranking-singers {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}

.ranking-singers .member-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
}

.song-ranking-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.song-ranking-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.song-ranking-main .ranking-name {
    width: 160px;
    flex-shrink: 0;
}

.song-ranking-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 38px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.song-ranking-detail .ranking-artist-sub {
    margin-top: 0;
    flex-shrink: 0;
}

[data-theme="light"] .song-ranking-item {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.ranking-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

[data-theme="light"] .ranking-bar-track {
    background: rgba(0, 0, 0, 0.06);
}

.ranking-bar-fill {
    height: 100%;
    background: var(--main-accent);
    border-radius: 3px;
    opacity: 0.35;
    transition: width 0.5s ease;
}

[data-theme="light"] .ranking-bar-fill {
    opacity: 0.7;
    background: #00838f;
}

.ranking-count {
    width: 45px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0.8;
    margin-left: auto;
}

/* --- Collaboration Ranking --- */
.collab-ranking-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.collab-ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.collab-pair {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.collab-x {
    font-size: 0.8rem;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .collab-pair {
        min-width: 0;
    }

    .collab-pair .member-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .collab-ranking-item .ranking-count {
        flex-shrink: 0;
        margin-left: auto;
    }
}

/* --- Stats Responsive --- */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .overlap-grid {
        grid-template-columns: 1fr;
    }

    .overlap-card.cyber-card {
        padding: 12px;
    }

    .overlap-badges .member-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .stat-member-name {
        width: 80px;
        font-size: 0.75rem;
    }

    .ranking-name {
        width: auto;
        flex-shrink: 1;
        white-space: normal;
        font-size: 0.8rem;
    }

    .ranking-song-info {
        flex-direction: column;
        gap: 0;
    }

    .ranking-song-info .ranking-name {
        white-space: normal;
        word-break: break-all;
    }

    .monthly-bar {
        width: 24px;
    }

    .heatmap-container {
        grid-auto-columns: 11px;
        grid-template-rows: repeat(7, 11px);
    }

    .heatmap-cell {
        width: 11px;
        height: 11px;
    }

    .heatmap-month-labels {
        grid-auto-columns: 11px;
    }

    .heatmap-day-labels {
        grid-template-rows: repeat(7, 11px);
    }

    .heatmap-day-labels span {
        height: 11px;
        font-size: 0.5rem;
    }

    .member-stat-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(26, 28, 35, 0.95) !important;
        box-shadow: none !important;
    }

    [data-theme="light"] .member-stat-card {
        background: rgba(255, 255, 255, 0.95) !important;
    }
}

/* ==============================
   Custom Prompt Modal
   ============================== */
.custom-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.custom-prompt-box {
    width: 90%;
    max-width: 360px;
    padding: 24px;
}

.custom-prompt-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
}

.custom-prompt-input:focus {
    border-color: var(--main-accent);
}

/* ==============================
   Playlist Styles
   ============================== */

.playlist-popover {
    background: var(--card-bg, rgba(26, 28, 35, 0.95));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    min-width: 180px;
    max-width: 250px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: popoverFadeIn 0.15s ease;
}

@keyframes popoverFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

[data-theme="light"] .playlist-popover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.playlist-popover-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--main-accent);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.playlist-popover-empty {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-bottom: 8px;
}

.playlist-popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.8rem;
    cursor: pointer;
}

.playlist-popover-item:hover {
    color: var(--main-accent);
}

.playlist-popover-item input[type="checkbox"] {
    accent-color: var(--main-accent);
    cursor: pointer;
}

.playlist-popover-actions {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 8px;
}

.playlist-popover-new {
    background: none;
    border: none;
    color: var(--main-accent);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 0;
}

.playlist-popover-new:hover {
    text-decoration: underline;
}

/* --- Playlist List Page --- */
.playlist-list-container {
    margin-top: 10px;
}

.playlist-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.playlist-list-card {
    padding: 20px;
}

.playlist-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.playlist-card-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.playlist-card-count {
    font-size: 0.85rem;
    color: var(--main-accent);
    font-weight: 700;
}

.playlist-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="light"] .secondary-btn {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #475569 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* ==============================
   モバイル最適化 追加スタイル
   ============================== */
@media (max-width: 768px) {
    /* 検索クリアボタンのタップエリア拡大 */
    #search-clear-btn {
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 1.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* プレイリストポップオーバーをモバイルで広く */
    .playlist-popover {
        min-width: 220px;
        max-width: 280px;
    }

    .playlist-popover-item {
        padding: 8px 0;
        min-height: 40px;
    }

    /* cyber-button のタップエリア確保 */
    .cyber-button.small {
        padding: 10px 16px;
        min-height: 40px;
        font-size: 0.85rem;
    }

    /* モーダル内のボタンも大きく */
    .cyber-modal-overlay .cyber-button.small,
    .custom-prompt-overlay .cyber-button.small {
        padding: 12px 18px;
        min-height: 44px;
    }

    /* テーマ切り替えボタンのタップエリア */
    .theme-toggle {
        min-height: 36px;
        padding: 4px 12px;
    }

    /* フッター余白（FABバー分） */
    .page-footer {
        padding-bottom: 70px;
    }
}

/* --- NEW Badge --- */
.new-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    line-height: 1.4;
    animation: newBadgePulse 2s ease-in-out infinite;
}

@keyframes newBadgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

[data-theme="light"] .new-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}