@charset "UTF-8";
/* ==========================================
   top.css - トップページSSRセクション専用スタイル
   タスク③ (2026-05-13): CTR最適化 + 人気ソフトセクション追加 + 下部統合
   構成:
     1. Hero compact 圧縮版
     2. 横スクロールカルーセル (.carousel-*)
     3. セクションヘッダー + もっと見るリンク (.section-header-with-link)
     4. 全件カタログ wrapper (.all-catalog-section)
     5. 下部統合 新着 / 過去最安値 (.bottom-sections / .bs-*)
     6. game-card variants (popular 追加)
     7. legacy: 旧 .top-section 系 (task② で導入、task③ では未使用)
   依存: style.css の CSS 変数 (--ps-blue, --bg-body, --radius-m 等)
   ========================================== */

/* ==========================================
   1. Hero compact (元 .hero-section の 60-70% へ圧縮)
   --------------------------------------------
   style.css の .hero-section を素地として、サイズ系のみ上書き
   ========================================== */
.hero-section--compact {
    padding: 22px 28px 20px;       /* 元 40px 32px 36px → 約60% */
    margin-bottom: 12px;
}
.hero-section--compact .app-logo        { height: 40px; margin-bottom: 0; }
.hero-section--compact .hero-logo-row   { display: flex; align-items: center; gap: 10px; }
.hero-section--compact .hero-title      { font-size: 19px; margin: 8px 0 4px; line-height: 1.35; }
.hero-section--compact .hero-desc       { font-size: 13px; line-height: 1.5; }
.hero-section--compact .hero-badges     { margin-top: 10px; }
.hero-section--compact .hero-articles-link { padding: 6px 14px; font-size: 13px; }
.hero-section--compact .hero-stats      { gap: 10px; }
.hero-section--compact .hero-stat       { padding: 10px 14px; min-width: 84px; border-radius: 10px; }
.hero-section--compact .hero-stat-num   { font-size: 20px; }
.hero-section--compact .hero-stat-label { font-size: 10px; margin-top: 3px; }

@media (max-width: 640px) {
    .hero-section--compact { padding: 16px 18px 16px; }
    .hero-section--compact .hero-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
    .hero-section--compact .app-logo { height: 34px; }
    .hero-section--compact .hero-title { font-size: 17px; }
    .hero-section--compact .hero-desc { font-size: 12px; }
    .hero-section--compact .hero-stats { width: 100%; gap: 8px; }
    .hero-section--compact .hero-stat { flex: 1; min-width: 0; padding: 8px 6px; }
    .hero-section--compact .hero-stat-num { font-size: 18px; }
}

/* ==========================================
   2. セクションヘッダー + もっと見るリンク
   ========================================== */
.section-header-with-link {
    max-width: 1200px;
    margin: 0 auto 12px auto;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.section-header-with-link--compact {
    margin: 0 0 10px 0;
    padding: 0;
}

.section-headline {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.section-headline--compact { font-size: 17px; gap: 8px; }
.section-headline--catalog {
    max-width: 1200px;
    margin: 0 auto 14px auto;
    padding: 0 4px;
    font-size: 22px;
}

.section-more-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--ps-blue);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 18px;
    background: rgba(0,112,209,0.10);
    border: 1px solid rgba(0,112,209,0.25);
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.section-more-link:hover {
    background: var(--ps-blue);
    color: #fff;
    border-color: var(--ps-blue);
}

@media (max-width: 640px) {
    .section-headline          { font-size: 17px; }
    .section-headline--compact { font-size: 15px; }
    .section-headline--catalog { font-size: 18px; }
    .section-more-link         { font-size: 12px; padding: 5px 10px; }
    .section-header-with-link  { padding: 0 8px; }
}

/* ==========================================
   3. 横スクロールカルーセル
   ========================================== */
.carousel-section {
    max-width: 1200px;
    margin: 0 auto 32px auto;
    padding: 0 4px;
    box-sizing: border-box;
}

/* セクションごとのアクセント（左ボーダーをヘッダー直下に） */
.carousel-section--popular .section-headline { color: #ff8a4a; }
.carousel-section--sale    .section-headline { color: #ff8093; }

.carousel-container {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 4px;
    -webkit-overflow-scrolling: touch;
    padding: 4px 4px 14px;     /* 下にスクロールバー分の余白 */
    /* scrollbar: 細く控えめに */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,112,209,0.45) rgba(255,255,255,0.04);
}
.carousel-container::-webkit-scrollbar { height: 8px; }
.carousel-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
}
.carousel-container::-webkit-scrollbar-thumb {
    background: rgba(0,112,209,0.45);
    border-radius: 4px;
}
.carousel-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0,112,209,0.7);
}

.carousel-track {
    display: flex;
    gap: 14px;
    /* 末尾にちょっと余白を入れて、右端カードが画面切れに見えるように */
    padding-right: 24px;
}

/* カルーセル内の game-card は横幅固定 + scroll-snap */
.carousel-track .game-card {
    flex: 0 0 200px;
    width: 200px;
    scroll-snap-align: start;
}

@media (max-width: 1024px) {
    .carousel-track .game-card { flex: 0 0 180px; width: 180px; }
}
@media (max-width: 640px) {
    .carousel-section          { margin-bottom: 24px; padding: 0 8px; }
    .carousel-track            { gap: 10px; padding-right: 16px; }
    .carousel-track .game-card { flex: 0 0 150px; width: 150px; }
    .carousel-container        { padding: 4px 4px 10px; }
}

/* ==========================================
   4. 全件カタログ wrapper
   ========================================== */
.all-catalog-section {
    max-width: 1200px;
    margin: 0 auto 32px auto;
    padding: 0 4px;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .all-catalog-section { padding: 0 8px; margin-bottom: 24px; }
}

/* ==========================================
   5. 下部統合（新着 + 過去最安値）
   PC: 横並び 2 カラム / モバイル: タブ切替（CSS-only）
   --------------------------------------------
   HTMLには両セクション常に出力 → SEOへの影響なし
   表示制御だけ CSS で切替
   ========================================== */
.bottom-sections {
    max-width: 1200px;
    margin: 0 auto 32px auto;
    padding: 0 4px;
    box-sizing: border-box;
}

/* hidden radio inputs (タブ切替用) */
.bs-tab-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* タブナビ（モバイル時のみ表示） */
.bs-tab-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    padding: 4px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
}
.bs-tab-btn {
    flex: 1;
    text-align: center;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, color 0.15s;
}
.bs-tab-btn:hover { color: #fff; }

/* :checked + ~ の連動で active 表示 */
#bs-tab-new:checked ~ .bs-tab-nav .bs-tab-btn--new {
    background: var(--ps-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,112,209,0.35);
}
#bs-tab-low:checked ~ .bs-tab-nav .bs-tab-btn--low {
    background: #ffc107;
    color: #3a2d00;
    box-shadow: 0 2px 8px rgba(255,193,7,0.35);
}

/* パネル本体 */
.bs-panels {
    /* モバイル: 縦並び、表示は1パネルのみ（タブ切替） */
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.bs-panel {
    background: linear-gradient(180deg, rgba(26,26,46,0.6) 0%, rgba(20,20,30,0.4) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-m);
    padding: 18px 18px 20px;
    box-sizing: border-box;
}
.bs-panel--new { border-left: 4px solid #4fc3f7; }
.bs-panel--low { border-left: 4px solid #ffc107; }
.bs-panel--new .section-headline { color: #4fc3f7; }
.bs-panel--low .section-headline { color: #ffc107; }

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

/* モバイル (<768px): タブ切替で 1パネルだけ表示 */
@media (max-width: 767px) {
    .bs-panels > .bs-panel { display: none; }
    #bs-tab-new:checked ~ .bs-panels > .bs-panel--new { display: block; }
    #bs-tab-low:checked ~ .bs-panels > .bs-panel--low { display: block; }
}

/* PC (≥768px): 横並び 2カラム、タブナビは非表示、両パネル常時表示 */
@media (min-width: 768px) {
    .bs-tab-nav { display: none; }
    .bs-panels {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .bs-grid { grid-template-columns: repeat(2, 1fr); }
}

/* タブナビが片方しか無い場合（片方0件）はナビ自体非表示 */
.bs-tab-nav:has(> :only-child) { display: none; }

@media (max-width: 640px) {
    .bottom-sections     { padding: 0 8px; margin-bottom: 24px; }
    .bs-panel            { padding: 14px 12px 16px; border-radius: 12px; }
    .bs-grid             { gap: 10px; }
    .bs-tab-btn          { font-size: 13px; padding: 8px 8px; }
}

/* ==========================================
   6. game-card variants（popular 追加）
   既存の .game-card 構造を流用。バッジ・価格色のみ追加。
   ========================================== */
.game-card-badge--popular {
    background: linear-gradient(135deg, #ff6b35 0%, #ff3d00 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,61,0,0.35);
}
.game-card-price--popular strong { color: #d32f2f; }

/* ==========================================
   7. 旧 SSR セクション (legacy: task② で導入、task③ で未使用)
   今後の rollback 用に残置。新 index.php からは参照されない。
   ========================================== */
.top-section {
    max-width: 1200px;
    margin: 0 auto 28px auto;
    padding: 20px 24px 24px;
    background: linear-gradient(180deg, rgba(26,26,46,0.6) 0%, rgba(20,20,30,0.4) 100%);
    border-radius: var(--radius-m);
    border: 1px solid rgba(255,255,255,0.06);
    border-left: 4px solid var(--ps-blue);
    box-sizing: border-box;
}
.top-section--sale     { border-left-color: #e94560; }
.top-section--new      { border-left-color: #4fc3f7; }
.top-section--lowprice { border-left-color: #ffc107; }

.top-section-header {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 16px 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}
.top-section-count {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    padding: 3px 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    margin-left: auto;
}
.top-section--sale     .top-section-header { color: #ff8093; }
.top-section--new      .top-section-header { color: #4fc3f7; }
.top-section--lowprice .top-section-header { color: #ffc107; }

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media (max-width: 1024px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  {
    .game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .top-section { padding: 16px 14px 18px; }
    .top-section-header { font-size: 17px; }
}
.top-section-empty {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}

/* ==========================================
   8. ゲームカード共通スタイル
   カルーセル / 下部統合グリッド / 旧 grid どこでも使用
   ========================================== */
.game-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    color: var(--text-card);
    border-radius: var(--radius-s);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(255,255,255,0.04);
}
.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.game-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #222;
    overflow: hidden;
}
.game-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.game-card:hover .game-card-img img { transform: scale(1.04); }

/* バッジ */
.game-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    letter-spacing: 0.3px;
}
.game-card-badge--sale     { background: #e94560; }
.game-card-badge--new      { background: #4fc3f7; color: #0d2438; }
.game-card-badge--preorder { background: #00bcd4; }
.game-card-badge--low      { background: #ffc107; color: #3a2d00; }

/* PS Plus 注記 */
.game-card-badge-note {
    position: absolute;
    top: 30px;
    left: 8px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.55);
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 2;
    letter-spacing: 0.2px;
}

/* カード本文 */
.game-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.game-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}
.game-card-meta {
    font-size: 11px;
    color: #888;
    font-weight: 500;
}
.game-card-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}
.game-card-price s {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
}
.game-card-price strong {
    color: #d32f2f;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.game-card-price--new strong { color: #0070d1; }
.game-card-price--low strong { color: #d97706; }

.game-card-price-label {
    font-size: 10px;
    color: #888;
    font-weight: 600;
    margin-right: 2px;
}

@media (max-width: 640px) {
    .game-card-title         { font-size: 12px; min-height: 2.6em; }
    .game-card-price strong  { font-size: 15px; }
    .game-card-body          { padding: 8px 10px 10px; }
}

/* ==========================================
   4. カルーセル左右ボタン (人気・セール)
   ========================================== */
.carousel-wrap {
    position: relative;
}
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: translateY(-50%) scale(1.1);
}
.carousel-prev { left: -8px; }
.carousel-next { right: -8px; }

@media (max-width: 768px) {
    .carousel-nav { width: 34px; height: 34px; font-size: 16px; }
}

/* ============================================
   サイドバー 楽天ランキング表示用追加スタイル
   暗テーマなので平テーマの指示書CSSを調整してある
   既存の .sidebar-rec-card / .sidebar-rec-img-wrap / .sidebar-rec-name
   には規則しない（style.css 側を保護）
   ============================================ */

/* サイドバー全体: 10件をスクロールなしで表示するため、
   style.css 側の max-height/overflow 制限を上書きで解除 */
.page-layout .sidebar {
    max-height: none;
}
.page-layout .sidebar .sidebar-section {
    max-height: none;
}
.page-layout .sidebar .sidebar-items {
    overflow-y: visible;
}

/* ページャー */
.sidebar-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.sidebar-pager-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #555;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.sidebar-pager-dot.active {
    background: #ff5a5f;
    transform: scale(1.25);
}
.sidebar-pager-dot:hover {
    background: #888;
}
/* 前へ・次へボタン（◂ ▸） */
.sidebar-pager-arrow {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 0 6px;
    font-size: 14px;
    line-height: 1;
    transition: color 0.2s, transform 0.15s;
}
.sidebar-pager-arrow:hover {
    color: #ff5a5f;
    transform: scale(1.2);
}

/* ============================================
   ヒーローエリア ナビゲーションボタン
   記事 / 人気ソフト / 新着 / 過去最安値
   （セール中は修正後に追加予定）
   既存の .hero-badges は flex+gap+wrap のまま使う
   全ボタンは min-width で幅を揃える
   ============================================ */
.hero-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 16px;
    min-width: 130px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
    white-space: nowrap;
}
.hero-nav-link:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
}

/* ホバー時はジャンル色で強調（各セクション見出しの色記号に伏せる） */
.hero-nav-link--article:hover {
    background: rgba(233, 30, 99, 0.18);
    border-color: #e91e63;
    color: #ff80ab;
}
.hero-nav-link--popular:hover {
    background: rgba(255, 90, 95, 0.18);
    border-color: #ff5a5f;
    color: #ff8a8e;
}
.hero-nav-link--new:hover {
    background: rgba(0, 112, 209, 0.20);
    border-color: #0070d1;
    color: #4fc3f7;
}
.hero-nav-link--low:hover {
    background: rgba(217, 119, 6, 0.20);
    border-color: #d97706;
    color: #fbbf24;
}

/* モバイル: ボタンを少し小さく、間隔も詰める */
@media (max-width: 768px) {
    .hero-nav-link {
        padding: 6px 12px;
        min-width: 110px;
        font-size: 12px;
    }
}


