/* =========================================
   Spaceliner Unified Style Sheet (Final Fix)
   ========================================= */

:root {
    --bg-black: #050505;
    --ui-gray: #1a1a1a;
    --ui-mid: #333;
    --ui-light: #ececec;
    --accent-red: #ff3c3c;
    --accent-blue: #00d2ff;
    --font-main: 'Exo 2', 'Noto Sans JP', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-black);
    color: var(--ui-light);
    font-family: var(--font-main);
    margin: 0;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- 起動アニメーション用の設定 --- */

/* 1. 初期状態：メインコンテンツを隠しておく */
main, .side-nav {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

/* 2. 起動完了時のクラス */
body.is-loaded main {
    opacity: 1;
    transform: translateY(0);
}

body.is-loaded .side-nav {
    opacity: 1;
}

/* 3. 画面全体を覆うグリッチ・ブート画面 */
.boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-black);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

/* 読み込み中のテキストアニメーション */
.boot-text {
    font-family: monospace;
    color: var(--accent-blue);
    font-size: 1rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent-blue);
    width: 0;
    animation: typing 0.5s steps(20, end) forwards, blink 0.5s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 250px; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-blue); }
}

/* フェードアウト用 */
.boot-overlay.is-finished {
    opacity: 0;
}

/* --- 背景演出 (Background Effects) --- */
.bg-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -10;
    perspective: 1000px;
}

.cross-line-l, .cross-line-r {
    position: absolute; width: 200%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    top: 50%; left: -50%; pointer-events: none;
}
.cross-line-l { transform: rotate(25deg); animation: bg-pulse 10s infinite alternate; }
.cross-line-r { transform: rotate(-25deg); animation: bg-pulse 10s infinite alternate-reverse; }

@keyframes bg-pulse { from { opacity: 0.1; } to { opacity: 0.5; } }

.grid-3d {
    position: absolute; width: 200%; height: 200%; top: -50%; left: -50%;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.075) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 80px 80px; transform: rotateX(65deg);
    animation: grid-move 5s linear infinite;
}
@keyframes grid-move { 0% { transform: rotateX(65deg) translateY(0); } 100% { transform: rotateX(65deg) translateY(80px); } }

.scanlines {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%);
    background-size: 100% 4px; z-index: 5; pointer-events: none;
}

/* --- ナビゲーション (Navigation) --- */
.side-nav {
    position: fixed; right: 25px; top: 50%; transform: translateY(-50%); z-index: 1000;
}
.side-nav ul { list-style: none; padding: 0; margin: 0; }
.side-nav a {
    color: var(--ui-light); text-decoration: none; writing-mode: vertical-rl;
    font-size: 0.75rem; letter-spacing: 4px; padding: 15px 5px;
    border-right: 1px solid rgba(255,255,255,0.2); transition: 0.3s;
    display: block;
}
.side-nav a:hover { color: var(--accent-red); border-right: 1px solid var(--accent-red); }

/* --- コンテンツ共通 (Common) --- */
section {
    padding: 60px 5%;
    max-width: 1200px; /* ここが全体の基本横幅になります */
    margin: 0 auto;
}

.sl-title {
    font-size: 1.8rem; padding: 8px 30px; background: var(--ui-gray);
    display: inline-block; transform: skewX(-20deg);
    border-left: 10px solid var(--accent-red); margin-bottom: 50px;
    font-weight: 700;
}

/* --- ヒーローエリア (Hero) --- */
.hero, .support-hero {
    min-height: 80vh; display: flex; align-items: center; justify-content: center;
    text-align: center; position: relative; padding: 0 5%;
}
.hero { height: 100vh; }
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 20%, var(--bg-black) 90%);
    z-index: 1;
}
.hero-content { position: relative; z-index: 10; }
.hero-icon { width: 160px; border-radius: 20px; margin-bottom: 20px; box-shadow: 0 0 30px rgba(0, 210, 255, 0.3); }
h1 { font-size: clamp(2.5rem, 8vw, 5.5rem); letter-spacing: 15px; margin: 0; font-weight: 700; text-shadow: 4px 4px 0 var(--ui-gray); }
.hero-tagline { font-size: 1rem; letter-spacing: 8px; opacity: 0.6; margin-top: 15px; text-transform: uppercase; }

/* --- ヒーローエリア専用の目立つDLボタン --- */
.hero-download-button {
    display: inline-block;
    border: 1px solid rgba(255, 60, 60, 0.5);
    background: rgba(255, 60, 60, 0.05);
    color: var(--accent-red);
    padding: 15px 50px;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 2px;
    transition: 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    clip-path: polygon(0 0, 95% 0, 100% 25%, 100% 100%, 5% 100%, 0 75%);
}

.hero-download-button:hover {
    background: var(--accent-red);
    color: #000;
    border-color: var(--accent-red);
    box-shadow: 0 0 25px rgba(255, 60, 60, 0.6);
    transform: translateY(-2px);
}

/* --- ニュース (News) --- */

.news-item {
    background: rgba(255,255,255,0.03);
    border-left: 3px solid var(--ui-mid);
    transition: 0.3s;
    cursor: pointer;
    position: relative;
}

.news-item:hover {
    background: rgba(255,255,255,0.07);
    border-left-color: var(--accent-blue);
}

.news-item.is-active {
    background: rgba(255,255,255,0.1);
    border-left-color: var(--accent-red);
}

.news-header {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* 💡 左右の両端に要素を分散配置する */
    width: 100%;
}

.news-headline {
    font-size: 1.1rem;
    margin: 0;
    flex: 1; /* 💡 タイトルエリアを限界まで横に広げ、＋ボタンを右端へ押し出す */
}

.news-icon {
    font-size: 1.2rem;
    color: var(--accent-blue);
    margin-left: 20px;
    font-weight: bold;
    flex-shrink: 0; /* 💡 画面幅が狭まっても＋ボタンが潰れないように固定 */
}

.news-meta {
    display: flex;
    align-items: center;
    flex: 1;
}

.news-date {
    color: var(--accent-blue);
    font-family: monospace;
    font-weight: bold;
    margin-right: 20px;
    min-width: 100px;
}

.news-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
    background: rgba(0, 0, 0, 0.2);
}

.news-content.is-open {
    max-height: 1000px;
    transition: max-height 0.6s ease-in;
}

.news-body-inner {
    padding: 0 25px 30px 25px;
}

.news-body {
    font-size: 0.95rem;
    opacity: 0.8;
    margin: 15px 0;
    line-height: 1.8;
}

.news-link {
    display: inline-block; background: var(--ui-light); color: #000;
    padding: 6px 20px; text-decoration: none; font-size: 0.75rem; font-weight: bold;
    clip-path: polygon(0 0, 90% 0, 100% 100%, 0% 100%); transition: 0.3s;
}
.news-link:hover { background: var(--accent-blue); transform: scale(1.05); }

@media (max-width: 600px) {
    .news-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .news-icon { position: absolute; right: 20px; top: 25px; }
}

/* --- NEWS一覧（MORE NEWS）ボタンのデザイン --- */
.news-more-btn-area {
    text-align: center;
    margin-top: 25px;
    width: 100%;
}

.news-more-button {
    display: inline-block;
    border: 1px solid rgba(0, 210, 255, 0.4);
    background: rgba(0, 210, 255, 0.05);
    color: var(--accent-blue);
    padding: 12px 40px;
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 2px;
    transition: 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    /* 右上と左下を少しだけカットしてシャープにする */
    clip-path: polygon(0 0, 95% 0, 100% 25%, 100% 100%, 5% 100%, 0 75%);
}

.news-more-button:hover {
    background: var(--accent-blue);
    color: #000;
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
    transform: translateY(-2px);
}


/* --- 5. HOW & SYSTEM 横並び2分割調整エリア --- */

/* 左右を包む大枠（section要素は個別にせず、ここで一括コントロール） */
/* 親コンテナ：最大幅を1200pxにして中央寄せ */
.top-panels-container {
    display: flex;
    gap: 40px; /* 左右のパネルの間の溝 */
    max-width: 1200px;
    margin: 0 auto 100px auto; /* 💡 3つ目の値を 40px から 100px に増やして下の重なりを回避！ */
    padding: 0 5%; /* sectionの左右パディングと連動 */
    align-items: stretch; /* 左右の要素の高さを同じに揃える */
}

/* 左右それぞれのパネルセクション */
.top-panels-container section {
    flex: 1;
    min-width: 0;
    padding: 0 !important; /* 個別セクションのpaddingを消し、コンテナ側で制御してズレを防ぐ */
    margin: 0;
}

/* HOW TO PLAYの枠 */
.how-to-container {
    border: 1px solid var(--ui-mid);
    background: rgba(5, 5, 5, 0.8);
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 中身のキーボードを上下中央寄せ */
}

/* SYSTEMの判定モック枠 */
.result-ui-mock {
    border: 1px solid var(--ui-mid);
    background: rgba(0,0,0,0.8);
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 95% 0, 100% 5%, 100% 100%, 5% 100%, 0 95%);
}

/* SYSTEMの内部装飾 */
.result-header { background: var(--ui-light); color: #000; padding: 10px 20px; font-size: 0.75rem; font-weight: bold; letter-spacing: 2px; }
.result-body { padding: 25px 30px; }
.judge-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }

/* モバイル表示（900px以下）の時の調整 */
@media (max-width: 900px) {
    .top-panels-container {
        flex-direction: column;
        gap: 40px;
    }
    .how-to-container, 
    .result-ui-mock {
        height: auto;
    }
    .result-ui-mock {
        clip-path: polygon(0 0, 92% 0, 100% 8%, 100% 100%, 8% 100%, 0 92%);
    }
}


/* --- キーボードパーツ設定 --- */
.control-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.key-row-top { display: flex; gap: 15px; }
.key-row-mid { height: 30px; display: flex; align-items: center; justify-content: center; }
.key-separator { font-size: 1.5rem; color: var(--accent-blue); font-weight: bold; opacity: 0.8; }
.key-row-bottom { display: flex; justify-content: center; }

.kb-key {
    width: 55px; height: 55px; background: var(--ui-gray); border: 2px solid var(--ui-mid);
    border-bottom: 5px solid #000; display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1.2rem; color: var(--ui-light); border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.space-key {
    width: 220px;
    background: linear-gradient(180deg, var(--ui-gray), #000);
    border-color: var(--accent-blue);
}

@media (max-width: 600px) {
    .kb-key { width: 45px; height: 45px; font-size: 1rem; }
    .space-key { width: 180px; }
}

/* --- CONNECT & RELATED --- */
.connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.connect-card { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--ui-mid); padding: 30px; text-decoration: none; color: inherit; transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); position: relative; overflow: hidden; }
.connect-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--accent-blue); transform: scaleX(0); transform-origin: left; transition: 0.4s; }
.connect-card:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-5px); border-color: var(--accent-blue); }
.connect-card:hover::before { transform: scaleX(1); }
.connect-tag { font-size: 0.6rem; color: var(--accent-blue); letter-spacing: 2px; margin-bottom: 10px; }
.connect-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 15px; letter-spacing: 3px; }
.connect-desc { font-size: 0.85rem; opacity: 0.6; line-height: 1.5; }

.connect-card.discord:hover { border-color: #5865F2; }
.connect-card.discord:hover .connect-tag { color: #5865F2; }
.connect-card.youtube:hover { border-color: #FF0000; }
.connect-card.youtube:hover .connect-tag { color: #FF0000; }

.related-banner { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(90deg, rgba(0, 210, 255, 0.1), rgba(0, 0, 0, 0.5)); border: 1px solid var(--accent-blue); padding: 40px; text-decoration: none; color: white; transition: 0.3s; }
.related-banner:hover { background: linear-gradient(90deg, rgba(0, 210, 255, 0.2), rgba(0, 0, 0, 0.8)); box-shadow: 0 0 20px rgba(0, 210, 255, 0.3); }
.related-tag { font-size: 0.7rem; color: var(--accent-blue); letter-spacing: 2px; }
.related-name { font-size: 2rem; margin: 5px 0; }


/* --- DOWNLOAD & SPEC --- */
.dl-card { background: rgba(13,13,13,0.9); padding: 50px 30px; border: 1px solid var(--ui-mid); text-align: center; }
.dl-button { display: inline-block; border: 2px solid var(--accent-blue); color: var(--accent-blue); padding: 18px 50px; text-decoration: none; font-weight: bold; font-size: 1.2rem; margin-bottom: 40px; transition: 0.3s; letter-spacing: 2px; }
.dl-button:hover { background: var(--accent-blue); color: #000; box-shadow: 0 0 25px var(--accent-blue); }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; text-align: left; }
.sub-title { font-size: 0.9rem; border-bottom: 1px solid var(--ui-mid); color: var(--accent-blue); margin-bottom: 15px; padding-bottom: 5px; }


/* --- FOOTER & UTILITY --- */
footer { padding: 80px 0; text-align: center; font-size: 0.6rem; letter-spacing: 5px; opacity: 0.4; }
.loading { text-align: center; opacity: 0.5; font-size: 0.8rem; letter-spacing: 3px; }


/* --- レスポンシブ (Mobile Base) --- */
@media (max-width: 800px) {
    h1 { font-size: 2.8rem; letter-spacing: 8px; }
    .hero-tagline { font-size: 0.8rem; letter-spacing: 4px; }
    .track-row { margin: 0 !important; clip-path: none !important; transform: none !important; padding: 20px; }
    .side-l, .side-r { background: var(--ui-gray); border-bottom: 1px solid var(--ui-mid); }
    .spec-grid { grid-template-columns: 1fr; }
    .side-nav { display: none; }
    section { padding: 60px 5%; }
}

/* =========================================
   SUPPORT ページ（FAQ）用追加スタイル
   ========================================= */

/* support.html のときも main 要素をしっかり表示させる */
body.is-loaded main {
    opacity: 1;
    transform: translateY(0);
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ui-mid);
    border-left: 4px solid var(--accent-blue);
    padding: 20px 25px;
    transition: 0.3s;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-left-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.1);
}

.faq-q {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-blue);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* 質問の頭に「Q.」を自動で付ける演出 */
.faq-q::before {
    content: "Q. ";
    color: var(--accent-red);
    margin-right: 8px;
    font-family: monospace;
}

.faq-a {
    font-size: 0.95rem;
    color: var(--ui-light);
    opacity: 0.85;
    line-height: 1.7;
    padding-left: 24px;
    white-space: pre-wrap; /* 改行を有効にする */
}

/* --- BUG STATUS BOARD (Optional pages) --- */
.status-tag { display: inline-block; padding: 3px 12px; font-size: 0.7rem; font-weight: bold; border-radius: 2px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.status-open { background: var(--accent-red); color: #fff; text-shadow: 0 0 5px #000; }
.status-work { background: #ffaa00; color: #000; }
.status-done { background: var(--accent-blue); color: #000; }

.bug-card { background: var(--panel-bg); border: 1px solid var(--ui-mid); padding: 20px; position: relative; overflow: hidden; }
.bug-card::before { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%; }
.bug-card.high::before { background: var(--accent-red); box-shadow: 0 0 10px var(--accent-red); }
.bug-card.mid::before { background: #ffaa00; }
.bug-card.low::before { background: var(--accent-blue); }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.tag-item { font-size: 0.65rem; color: var(--accent-blue); background: rgba(0, 210, 255, 0.1); border: 1px solid rgba(0, 210, 255, 0.3); padding: 2px 8px; }

/* =========================================
   モバイル・スマホ最適化（上書き・追加）
   ========================================= */

@media (max-width: 800px) {
    /* 1. 楽曲リストのホバー・タップ時のガタつき・ズレを完全に抑え込む */
    .track-row {
        margin: 0 0 10px 0 !important;
        clip-path: none !important;
        transform: none !important;
        padding: 15px 20px !important;
        background: var(--ui-gray) !important; /* グラデーションから単色にして見やすく */
        border: 1px solid var(--ui-mid);
        border-radius: 4px;
    }

    /* スマホではホバーアニメーションを無効化（横揺れを防止） */
    .side-l:hover, .side-r:hover {
        transform: none !important;
        background: var(--ui-gray) !important;
        color: var(--ui-light) !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* セル内の配置をスマホ用に最適化 */
    .track-cell {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .side-r .track-cell {
        text-align: left;
    }

    .track-title {
        font-size: 1.3rem; /* 文字サイズを少しスマホ向けに小さく */
    }

    /* 2. スクールトラップ対策：スマホではリストを固定高にせず全表示（または高さを広げる） */
    .track-scroll-area {
        max-height: none !important; 
        overflow-y: visible !important;
        padding-right: 0;
    }

    /* 3. 難易度・レベルソートの余白調整 */
    .filter-group {
        gap: 8px 5px; /* 縦方向の隙間をしっかり確保 */
    }
    .filter-header {
        margin-bottom: 5px;
        transform: none; /* スマホでは斜めを戻して文字を読みやすく */
    }
    .level-range-filter {
        margin-left: 0;
        margin-top: 5px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* 4. 極小画面（iPhone SEなど）でのキーボード配置の崩れ防止 */
    .how-to-container {
        padding: 20px 10px;
    }
    .key-row-top {
        gap: 8px;
    }
    .kb-key {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    .space-key {
        width: 150px;
    }
    
    /* ニュースの文字サイズ微調整 */
    .news-headline {
        font-size: 1rem;
    }
}


/* --- 楽曲リスト (Music Cross UI) --- */
.search-container { margin-bottom: 20px; width: 100%; max-width: 600px; }
#track-search {
    width: 100%; background: rgba(255, 255, 255, 0.05); border: none;
    border-left: 4px solid var(--accent-blue); padding: 12px 20px;
    color: var(--ui-light); font-family: var(--font-main); font-size: 1rem;
    letter-spacing: 2px; outline: none; transition: 0.3s;
}
#track-search:focus { background: rgba(255, 255, 255, 0.1); border-left-color: var(--accent-red); box-shadow: 0 0 15px rgba(0, 210, 255, 0.2); }
#track-search::placeholder { color: rgba(255, 255, 255, 0.3); font-size: 0.8rem; }

.filter-group { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.filter-item { cursor: pointer; user-select: none; }
.filter-item input { display: none; }

.filter-header {
    font-size: 0.7rem; color: var(--accent-blue); background: rgba(0, 210, 255, 0.1);
    padding: 2px 10px; margin-right: 5px; border-left: 3px solid var(--accent-blue);
    display: flex; align-items: center; font-weight: bold; letter-spacing: 1px;
    text-transform: uppercase; transform: skewX(-15deg);
}

@media (max-width: 800px) {
    .filter-header { width: 100%; margin-bottom: 5px; margin-left: 0 !important; }
}

.filter-label { display: inline-block; padding: 5px 15px; border: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.75rem; font-weight: bold; transition: 0.3s; background: rgba(0, 0, 0, 0.3); }
.filter-item input:checked + .filter-label { background: var(--ui-light); color: #000; box-shadow: 0 0 10px rgba(255, 255, 255, 0.2); }

.filter-item input:checked + .st-color { border-color: #00ffcc; color: #00ffcc; background: rgba(0, 255, 204, 0.1); }
.filter-item input:checked + .fd-color { border-color: #ffff00; color: #ffff00; background: rgba(255, 255, 0, 0.1); }
.filter-item input:checked + .od-color { border-color: #ff0066; color: #ff0066; background: rgba(255, 0, 102, 0.1); }
.filter-item input:checked + .ul-color { border-color: #aa00ff; color: #aa00ff; background: rgba(170, 0, 255, 0.1); }

.level-range-filter { display: flex; align-items: center; gap: 8px; margin-left: 10px; color: var(--ui-light); font-size: 0.8rem; }
.level-range-filter input { width: 60px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--ui-mid); color: var(--accent-blue); padding: 4px 8px; text-align: center; font-family: var(--font-main); outline: none; }
.level-range-filter input::-webkit-inner-spin-button, .level-range-filter input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.level-range-filter input:focus { border-color: var(--accent-blue); background: rgba(0, 210, 255, 0.1); }

.track-scroll-area { display: flex; flex-direction: column; gap: 15px; max-height: 565px; overflow-y: auto; padding-right: 10px; }
.track-container { display: flex; flex-direction: column; gap: 4px; }
.track-row { position: relative; padding: 20px 40px; transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1); cursor: pointer; text-decoration: none; color: inherit; }

.side-l { background: linear-gradient(90deg, var(--ui-gray) 0%, transparent 100%); clip-path: polygon(0 0, 90% 0, 98% 100%, 0% 100%); margin-right: 8%; }
.side-r { background: linear-gradient(-90deg, var(--ui-gray) 0%, transparent 100%); clip-path: polygon(2% 0, 100% 0, 100% 100%, 10% 100%); margin-left: 8%; text-align: right; }

.side-l:hover { transform: translateX(30px); background: var(--ui-light); color: #000; border-left: 6px solid var(--accent-red); }
.side-r:hover { transform: translateX(-30px); background: var(--ui-light); color: #000; border-right: 6px solid var(--accent-blue); }

.track-cell { display: flex; align-items: center; gap: 20px; }
.side-r .track-cell { justify-content: flex-end; }

.track-levels { display: flex; }
.ST-label { padding: 5px; font-size: 1.5rem; font-weight: 900; color: #3dff3d; font-style: italic; }
.FD-label { padding: 5px; font-size: 1.5rem; font-weight: 900; color: #ffff3d; font-style: italic; }
.OD-label { padding: 5px; font-size: 1.5rem; font-weight: 900; color: var(--accent-red); font-style: italic; }
.UL-label { padding: 5px; font-size: 1.5rem; font-weight: 900; color: #9e3dff; font-style: italic; }

.track-row:hover .ST-label { color: #008000; }
.track-row:hover .FD-label { color: #8a8a00; }
.track-row:hover .OD-label { color: #b30000; }
.track-row:hover .UL-label { color: #5a00b3; }

.track-row:hover .track-cell [class*="-label"] { text-shadow: 1px 1px 0px rgba(255,255,255,0.5); transition: color 0.3s; }
.track-title { font-size: 1.6rem; font-weight: 700; display: block; line-height: 1.2; }
.track-artist { font-size: 0.85rem; opacity: 0.6; }


/* =========================================
   モバイル・スマホ最適化（上書き・追加）
   ========================================= */

@media (max-width: 800px) {
    /* 1. 楽曲リストのホバー・タップ時のガタつき・ズレを完全に抑え込む */
    .track-row {
        margin: 0 0 10px 0 !important;
        clip-path: none !important;
        transform: none !important;
        padding: 15px 20px !important;
        background: var(--ui-gray) !important; /* グラデーションから単色にして見やすく */
        border: 1px solid var(--ui-mid);
        border-radius: 4px;
    }

    /* スマホではホバーアニメーションを無効化（横揺れを防止） */
    .side-l:hover, .side-r:hover {
        transform: none !important;
        background: var(--ui-gray) !important;
        color: var(--ui-light) !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* セル内の配置をスマホ用に最適化 */
    .track-cell {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .side-r .track-cell {
        text-align: left;
    }

    .track-title {
        font-size: 1.3rem; /* 文字サイズを少しスマホ向けに小さく */
    }

    /* 2. スクールトラップ対策：スマホではリストを固定高にせず全表示（または高さを広げる） */
    .track-scroll-area {
        max-height: none !important; 
        overflow-y: visible !important;
        padding-right: 0;
    }

    /* 3. 難易度・レベルソートの余白調整 */
    .filter-group {
        gap: 8px 5px; /* 縦方向の隙間をしっかり確保 */
    }
    .filter-header {
        margin-bottom: 5px;
        transform: none; /* スマホでは斜めを戻して文字を読みやすく */
    }
    .level-range-filter {
        margin-left: 0;
        margin-top: 5px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* 4. 極小画面（iPhone SEなど）でのキーボード配置の崩れ防止 */
    .how-to-container {
        padding: 20px 10px;
    }
    .key-row-top {
        gap: 8px;
    }
    .kb-key {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    .space-key {
        width: 150px;
    }
    
    /* ニュースの文字サイズ微調整 */
    .news-headline {
        font-size: 1rem;
    }
}
