/* Google Fonts のインポート */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
    /* 画像 (RECOsShop.png) ベースのカラーパレット */
    --bg-color: #050505; /* 背景を黒ベース */
    --sidebar-bg: rgba(10, 10, 10, 0.85);
    --surface-color: rgba(30, 30, 30, 0.5); /* 表面色 */
    --text-primary: #fff0f7; /* 白に近い淡いピンク */
    --text-secondary: #d47cb4; /* サブテキスト */
    --accent-color: #c61071; /* アクセント */
    --accent-hover: #e31683; /* アクセントのホバー色 */
    --accent-glow: rgba(198, 16, 113, 0.4);
    --border-color: rgba(212, 124, 180, 0.15); /* 境界線 */
    
    --font-sans: 'Inter', 'Noto Sans JP', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; /* 全体スクロールを無効化し、各領域でスクロールする */
}

/* ==========================================================================
   Background Video & CRT Scanline Layers (Lyrics Page)
   ========================================================================== */
.video-background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.75) contrast(1.15) saturate(1.1);
    opacity: 0.8;
}

.video-overlay-scanlines {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.2) 0px,
        rgba(0, 0, 0, 0.2) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    opacity: 0.5;
}

.video-overlay-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(
        ellipse at 50% 45%,
        transparent 45%,
        rgba(0, 0, 0, 0.35) 75%,
        rgba(0, 0, 0, 0.7) 100%
    );
    pointer-events: none;
}

/* アプリケーション全体コンテナ（動画の手前に配置） */
.app-container {
    position: relative;
    z-index: 5;
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* サイドバー */
.sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.sidebar-header {
    padding: 20px 24px 24px;
    border-bottom: 1px solid var(--border-color);
}

.header-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sidebar-social-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.social-mini-link {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 3px 7px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.social-mini-link:hover {
    color: #fff;
    border-color: var(--accent-color);
    background: rgba(198, 16, 113, 0.2);
    box-shadow: 0 0 6px var(--accent-glow);
}

.back-to-top-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.back-to-top-link:hover {
    color: #ffffff;
    border-color: var(--accent-color);
    background: rgba(198, 16, 113, 0.2);
    box-shadow: 0 0 8px var(--accent-glow);
    transform: translateX(-2px);
}

.back-arrow {
    transition: transform 0.2s ease;
}

.back-to-top-link:hover .back-arrow {
    transform: translateX(-2px);
}

.header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.toggle-list-btn {
    display: none; /* デスクトップでは非表示 */
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.toggle-list-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #fff, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.search-container {
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* インデックスナビゲーション */
.index-nav-wrapper {
    margin-top: 12px;
}

.index-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
}

.index-nav-btn {
    min-width: 26px;
    height: 24px;
    padding: 0 4px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.index-nav-btn.active {
    color: var(--text-primary);
    background-color: rgba(198, 16, 113, 0.15);
    border-color: rgba(198, 16, 113, 0.4);
}

.index-nav-btn.active:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
    transform: translateY(-1px);
}

.index-nav-btn.disabled {
    opacity: 0.2;
    cursor: not-allowed;
    border-color: transparent;
    background-color: transparent;
}

/* 作詞者フィルター */
.lyricist-filter-wrapper {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.filter-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.filter-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.lyricist-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.lyricist-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.lyricist-filter-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.lyricist-filter-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 0 8px var(--accent-glow);
}

.lyricist-count {
    font-size: 0.62rem;
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.3);
    padding: 0 4px;
    border-radius: 6px;
}

.song-list-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 0;
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.song-list {
    list-style: none;
}

.song-item {
    padding: 12px 24px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.song-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-lyricist-tag {
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(198, 16, 113, 0.15);
    color: #ff9ed2;
    border: 1px solid rgba(198, 16, 113, 0.3);
    margin-left: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.song-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.song-item.active {
    background-color: rgba(244, 63, 94, 0.1);
    border-left-color: var(--accent-color);
    color: #fff;
    font-weight: 500;
}

/* アルファベット等の見出し */
.list-group-title {
    padding: 16px 24px 8px;
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* メインコンテンツ（歌詞表示領域） */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: rgba(4, 4, 7, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.lyrics-container {
    flex: 1;
    overflow-y: auto;
    padding: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 初期表示・空状態 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.7;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* ローディング状態 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(212, 124, 180, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
    box-shadow: 0 0 10px var(--accent-glow);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lyrics-header {
    margin-bottom: 36px;
    text-align: center;
}

.lyricist-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 14px;
    background: rgba(198, 16, 113, 0.12);
    border: 1px solid rgba(198, 16, 113, 0.3);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.lyricist-badge .badge-name {
    color: #fff;
    font-weight: 600;
}

.song-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 0.05em;
    animation: slideDown 0.4s ease backwards;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 0 25px rgba(198, 16, 113, 0.35);
}

.lyrics-text {
    font-size: 1.1rem;
    line-height: 2;
    white-space: pre-wrap;
    text-align: center;
    max-width: 800px;
    width: 100%;
    animation: fadeIn 0.5s ease backwards;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
    body {
        overflow: auto; /* スマホではページ全体のスクロールを許可 */
    }
    .app-container {
        display: block; /* flexをやめて縦積み */
        height: auto;
        min-height: 100vh;
    }
    .toggle-list-btn {
        display: block; /* スマホでは表示 */
    }
    .sidebar {
        width: 100%;
        height: 65vh; /* スマホ時のサイドバー表示領域 */
        display: flex;
        flex-direction: column;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        transition: height 0.3s ease;
        overflow: hidden;
    }
    .sidebar-header {
        position: relative;
        padding: 16px;
        z-index: 2;
        background-color: var(--sidebar-bg);
        flex-shrink: 0;
        border-bottom: 1px solid var(--border-color);
    }
    .sidebar-header h1 {
        font-size: 1.3rem;
    }
    .sidebar-header p {
        margin-bottom: 10px;
        font-size: 0.75rem;
    }
    .search-container input {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .index-nav-wrapper {
        margin-top: 8px;
    }
    .index-nav-btn {
        min-width: 24px;
        height: 22px;
        font-size: 0.68rem;
    }
    .song-list-container {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        position: relative;
        padding: 8px 0 20px;
    }
    .sidebar.collapsed {
        height: auto;
    }
    .sidebar.collapsed .index-nav-wrapper,
    .sidebar.collapsed .lyricist-filter-wrapper,
    .sidebar.collapsed .search-container,
    .sidebar.collapsed .song-list-container {
        display: none;
    }
    .sidebar.collapsed .toggle-list-btn {
        transform: rotate(180deg);
    }
    .main-content {
        display: block;
        height: auto;
        min-height: 50vh;
    }
    .lyrics-container {
        padding: 30px 20px;
        height: auto;
        overflow-y: visible; /* ページ全体のスクロールに任せる */
    }
}


/* ==========================================================================
   Lyrics Page Unified Action Bar Section
   ========================================================================== */
.lyrics-action-panel {
    width: 100%;
    max-width: 800px;
    margin-top: 48px;
    padding: 16px 20px;
    background: rgba(14, 10, 22, 0.7);
    border: 1px solid rgba(198, 16, 113, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(198, 16, 113, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.5s ease backwards;
}

.lyrics-action-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 124, 180, 0.12);
}

.lyrics-action-panel-tag {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--accent-color);
    text-transform: uppercase;
}

.lyrics-action-panel-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    opacity: 0.8;
}

.lyrics-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.lyrics-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(212, 124, 180, 0.16);
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s ease;
    gap: 10px;
}

.lyrics-action-item:hover {
    background: rgba(198, 16, 113, 0.15);
    border-color: var(--item-accent, #c61071);
    box-shadow: 0 0 16px rgba(198, 16, 113, 0.3);
    transform: translateY(-2px);
}

.lyrics-action-item.item-booth {
    --item-accent: #fc4d51;
}

.lyrics-action-item.item-youtube {
    --item-accent: #ff0000;
}

.lyrics-action-item.item-cluster {
    --item-accent: #00d2ff;
}

.lyrics-action-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.lyrics-action-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.lyrics-action-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lyrics-action-sublabel {
    font-size: 0.68rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.lyrics-action-mainbtn {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-top: 2px;
}

.lyrics-action-arrow {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.lyrics-action-item:hover .lyrics-action-arrow {
    transform: translateX(3px);
    color: var(--item-accent, #c61071);
}

@media (max-width: 768px) {
    .lyrics-action-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .lyrics-action-panel {
        margin-top: 32px;
        padding: 14px 16px;
    }
}

/* ==========================================================================
   Lyrics Page Slim Top HUD Action Bar
   ========================================================================== */
.top-hud-bar {
    width: 100%;
    z-index: 30;
    background: rgba(10, 8, 14, 0.85);
    border-bottom: 1px solid rgba(198, 16, 113, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 24px;
    flex-shrink: 0;
}

.top-hud-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.top-hud-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: 0.12em;
}

.top-hud-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 124, 180, 0.2);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hud-link-pill .hud-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.hud-link-pill .hud-arrow {
    font-size: 0.72rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease, color 0.2s ease;
}

.hud-link-pill:hover {
    background: rgba(198, 16, 113, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(198, 16, 113, 0.35);
    transform: translateY(-1px);
}

.hud-link-pill:hover .hud-arrow {
    transform: translateX(2px);
    color: #fff;
}

.hud-link-pill.hud-booth:hover {
    border-color: #fc4d51;
}

.hud-link-pill.hud-youtube:hover {
    border-color: #ff0000;
}

.hud-link-pill.hud-cluster:hover {
    border-color: #00d2ff;
}

@media (max-width: 768px) {
    .top-hud-bar {
        padding: 6px 12px;
        position: sticky;
        top: 0;
    }
    .top-hud-label {
        display: none; /* スマホでは省スペースのため非表示 */
    }
    .top-hud-inner {
        justify-content: center;
    }
    .top-hud-links {
        gap: 6px;
        width: 100%;
        justify-content: space-around;
    }
    .hud-link-pill {
        padding: 4px 8px;
        font-size: 0.72rem;
        flex: 1;
        justify-content: center;
    }
}