/* ==========================================
   1. 変数・リセット・基本設定
   ========================================== */
:root {
    --main-bg: #fff9fa;
    --accent-color: #ff6b81;
    --text-dark: #2f3542;
    --text-light: #747d8c;
    --youtube-red: #ff0000;
}

body {
    background-color: var(--main-bg);
    color: var(--text-dark);
    /* font-family: 'M PLUS Rounded 1c', sans-serif; */
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif, "Segoe UI Emoji";
    margin: 0;
    padding-top: 80px; /* 2段ヘッダーの高さを確保 */
    overflow-x: hidden; /* 横スクロールバーを隠す */
}

/* ==========================================
   2. ヘッダー・フッター・ナビゲーション
   ========================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
    background: rgb(255 255 255 / 80%);
    backdrop-filter: blur(10px);
    display: block;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 40px;
    box-sizing: border-box;
}
.header-top a {
    display: flex;
    align-items: center;
    height: 100%; /* 親要素(header-top)の高さに合わせる */
    text-decoration: none;
}

/* 4. 中央のロゴを正確にセンターに置くための調整 */
.header-center {
    flex: 1;
    text-align: center;
}

.home-btn {
    width: auto;
    height: 24px;
    display: block;
}
.x-log {
    width: auto;
    height: 21px;
    padding: 3px;
    display: block;
    background-color: black;
}

.back-btn {
    text-decoration: none;
    /* color: var(--accent-color); */
    font-size: 20px;
    font-weight: 700;
    padding: 5px;
}


.magazine-logo {
    /* color: var(--accent-color); */
    color: var(--text-dark);
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    background: rgb(255 255 255 / 50%);
    border-top: 1px solid #ffdde1;
    border-bottom: 2px solid #ffdde1;
    overflow-x: auto;
    overflow-y: hidden;
    height: 40px;
    box-sizing: border-box;
}

.nav-item {
    flex: 1;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-light);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
}

.nav-item:hover {
    background: #fff0f2;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.nav-item.active {
    font-weight: 700;
    color: var(--accent-color);
    background: rgb(255 107 129 / 5%);
}

.nav-item.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
}
/* ランキング切り替えタブ */
.ranking-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.ranking-tab {
    text-decoration: none;
    background: #fff;
    color: var(--text-light);
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid #ffdde1;
    transition: 0.3s;
}

.ranking-tab:hover {
    background: #fff0f2;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.ranking-tab.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 10px rgba(255, 107, 129, 0.3);
}

/* フッター */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 12px;
    border-top: 1px solid #eee;
    margin-top: 40px;
}
/* ==========================================
   3. 日付ナビゲーション・共通パーツ
   ========================================== */
.date-nav { display: flex; justify-content: center; align-items: center; gap: 20px; margin-bottom: 30px; background: white; padding: 15px; border-radius: 50px; box-shadow: 0 5px 15px rgb(0 0 0 / 5%); }
.date-btn { text-decoration: none; color: var(--accent-color); font-weight: 700; padding: 8px 20px; border: 2px solid var(--accent-color); border-radius: 25px; transition: 0.2s; }
.date-btn:hover:not(.disabled) { background: var(--accent-color); color: white; }
.date-btn.disabled { pointer-events: none; color: #ccc; border-color: #eee; cursor: default; }
.display-range { font-size: 18px; text-align: center; font-weight: 700; pointer-events: none; }

/* カレンダー検索UI */
.calendar-search { position: relative; display: flex; align-items: center; cursor: pointer; padding: 5px 10px; border-radius: 20px; transition: background 0.2s; }
.calendar-search:hover { background: rgba(255, 107, 129, 0.05); }
.calendar-icon { font-size: 1.2em; margin-left: 8px; color: var(--accent-color); pointer-events: none; }
.date-picker-hidden { position: absolute; width: 0; height: 0; opacity: 0; border: none; pointer-events: none; }

/* ==========================================
   4. メインレイアウト構造・共通パーツ
   ========================================== */
.main-layout {
    display: flex;
    max-width: 1100px;
    margin: 40px auto;
    gap: 30px;
    padding: 0 20px;
}

.content-area {
    flex: 2;
    min-width: 0;
}

.sidebar {
    flex: 1;
}

.page-title {
    text-align: center;
    font-size: 24px;
    margin: 0 0 20px 0;
}

.coution-word {
    font-size: 16px;
    padding: 0 20px; 
    color:var(--text-light);
}

.history-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 20px rgb(0 0 0 / 5%);
}

.info-main-text-group {
    display: flex;
    align-items: center; /* 縦方向の中央揃え */
    flex-wrap: wrap;     /* 収まらない場合に折り返す設定に変更 */
    gap: 5px 0;          /* 折り返した時の上下の隙間（5px） */
}

.info-box {
    background: #fff;
    border-left: 5px solid var(--accent-color);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.info-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--accent-color);
}
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    max-height: 100px; /* 長くなったらスクロールさせる */
    overflow-y: auto;
}
.info-list li {
    margin-bottom: 5px;
}
.info-list li span {
    color: #999;
    margin-right: 10px;
}

/* ==========================================
   5. サイドバー（EDITOR'S PICK! / 広告）
   ========================================== */
/* --- 通常（PC用）の表示設定 --- */
.ad-pc {
    display: block; /* PC用を表示 */
    text-align: center; /* 中央寄せにする場合 */
}
.ad-sp {
    display: none;  /* スマホ用を隠す */
}

.promo-card {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid var(--accent-color);
    position: sticky;
    top: 100px;
}

.promo-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.promo-label {
    font-size: 11px;
    background: var(--accent-color);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    margin: 0;
    white-space: nowrap;
}

.promo-user-msg {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-color);
    display: none;
}

.promo-user-msg.active {
    display: inline-block;
}

.promo-media-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    margin: 15px 0;
    background: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 40%);
}

.slideshow-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: 1s;
    visibility: hidden;
}

.slideshow-item.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    z-index: 1;
}

.promo-room-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.promo-room-name {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
    text-align: left;
}

.promo-room-desc {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.4;
    text-align: left;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.promo-room-name-overlay {
    position: absolute;
    bottom: 0; width: 100%;
    background: rgba(255, 107, 129, 0.7);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 0;
}

.promo-card .room-card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    display: block;
}

/* ==========================================
   6. リンク用共通アイコン
   ========================================== */
/* ボタン風リンクの共通ベーススタイル */
.yt-link, .log-link {
    display: inline-flex;
    align-items: center;
    color: white !important;
    font-family: 'Fredoka', sans-serif;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    text-decoration: none;
    margin-left: 8px;
    font-weight: 700;
    white-space: nowrap;
}

/* YouTube用の赤 */
.yt-link {
    background: var(--youtube-red);
}

/* 歌唱履歴用のピンク（アクセントカラー） */
.log-link {
    background: var(--accent-color);
}

/* ==========================================
   7. 共通レスポンシブ設定
   ========================================== */
@media (max-width: 768px) {
    body { padding-top: 85px; }
    .header-top { padding: 0 15px; }
    .magazine-logo { font-size: 13px; }
    .nav-item { font-size: 12px; }
    .main-layout {
        flex-direction: column;
        margin: 20px auto;
        gap: 20px;
        padding: 0 10px;
    }
    .page-title { font-size: 18px;}
    .ranking-table th, .ranking-table td { padding: 10px 0; }
    .medal-icon { width: auto; }
    .rank-col { width: 30px; min-width: 30px; }
    .count-col { width: 55px; min-width: 55px; text-align: center; }
    .link-col { width: 65px; min-width: 65px; }
    .room-col { width: auto; word-break: break-all; text-align: left; line-height: 1.3; }
    .room-link { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .sidebar { order: -1; width: 100%; }
    .ad-pc {
        display: none;  /* PC用を隠す */
    }
    .ad-sp {
        display: block; /* スマホ用を表示 */
        text-align: center; /* 中央寄せにする場合 */
    }
    .promo-card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 12px !important;
        box-sizing: border-box;
    }
    .promo-room-link {
        display: flex !important;
        flex-direction: row !important; 
        align-items: center !important;
        text-decoration: none;
        gap: 5px;
        width: 100%;
    }
    .promo-header-row {
        width: 100% !important;
        margin-bottom: 12px;
    }    
    .promo-media-box {
        aspect-ratio: auto;
        margin: 0;
    }
    .slideshow-item {
        position: relative;
        opacity: 1;
        visibility: visible;
        display: none;
    }
    .slideshow-item.active {
        display: block;
    }
    .promo-card .room-card-img {
        width: 120px;
        border-radius: 0;
        padding: 2px;
        flex-shrink: 0;
    }
    .room-card-info {
        flex: 1;
        min-width: 0;
        display: flex !important;
        flex-direction: column !important;
        text-align: left !important;
    }
    .promo-room-name {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .promo-room-name-overlay { 
        display: none;
    }
    .promo-room-desc {
        font-size: 0.7rem !important;
        color: var(--text-dark);
        line-height: 1.4;
        line-clamp: 3;
        display: -webkit-box;
        -webkit-line-clamp: 3; /* 3行で省略 */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .ranking-tab {
        font-size: 14px;
        padding: 8px 12px;
    }

    .date-nav {
        gap: 12px;
        padding: 10px;
    }
    .date-btn {
        font-size: 14px;
        padding: 8px 12px;
    }
    .display-range {
        font-size: 14px;
    }

    .coution-word {
        font-size: 12px;
    }

    .history-card {
        padding: 15px;
    }
}