/* =========================================
   style.css vMaster - 本番サイト・絶対安定版
   ========================================= */

body {
    margin: 0; padding: 0; font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background: #f2f2f7; color: #1c1c1e; display: flex; justify-content: center;
}
.hidden { display: none !important; }

/* 🏠 メインコンテナ（スマホ幅に固定・パソコンで崩れない） */
#main-content {
    width: 100%; max-width: 500px; min-height: 100vh;
    background: white; box-shadow: 0 0 60px rgba(0,0,0,0.05);
    position: relative; overflow-x: hidden;
}

/* 🌫️ 年齢認証 ＆ クッションステージ */
#age-gate {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(30px);
    z-index: 100000; display: none; align-items: center; justify-content: center;
    flex-direction: column; text-align: center;
}
.content-blurred { filter: blur(35px) grayscale(0.5); pointer-events: none; }

.cushion-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(30px) saturate(1.8);
    -webkit-backdrop-filter: blur(30px) saturate(1.8);
    z-index: 90000; display: none; overflow-y: auto;
    animation: springReveal 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes springReveal {
    0% { opacity: 0; transform: scale(1.05) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.cushion-content {
    max-width: 500px; /* メインサイトと同じ幅に戻す */
    margin: 0 auto;
    padding: 60px 0;
    text-align: center;
    position: relative;
}
.cushion-close-btn {
    position: fixed; top: 25px; right: 25px; width: 42px; height: 42px;
    background: rgba(44, 44, 46, 0.1); backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); font-size: 22px;
    color: #1c1c1e; cursor: pointer; display: flex; align-items: center; justify-content: center;
    z-index: 100; transition: 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.cushion-close-btn:hover { background: rgba(0,0,0,0.05); transform: scale(1.1) rotate(90deg); }
.cushion-close-btn:active { transform: scale(0.9); }

.cushion-work-visual {
    display: flex; /* 中央寄せを確実にするためflex化 */
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 440px; 
    max-height: 50vh; 
    margin: 0 auto 15px; 
    padding: 0;
    position: relative;
    perspective: 1000px;
}
.cushion-work-visual img {
    display: block;
    width: auto; /* コンテンツに合わせる */
    height: auto;
    max-width: 100%; /* 横は親に合わせる */
    max-height: 50vh; /* 縦は画面の50%までに抑える */
    /* object-fit: contain は削除。代わりにタグ自体のサイズを収縮させる */
    border-radius: 16px;
    /* 2重のシャドウ: 立体感と柔らかな拡散光 */
    box-shadow: 
        0 10px 20px rgba(0,0,0,0.1),
        0 30px 60px rgba(0,0,0,0.08);
    transition: 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
    animation: floatImage 6s ease-in-out infinite;
}
.cushion-work-visual:hover img {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 15px 30px rgba(0,0,0,0.12),
        0 40px 80px rgba(0,0,0,0.12);
}

@keyframes floatImage {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.btn-large-jack {
    display: block; padding: 18px 25px; border-radius: 50px;
    background: #1c1c1e; color: white; text-decoration: none;
    font-weight: 800; font-size: 17px; margin-top: 10px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.btn-large-jack:hover { transform: scale(1.02); filter: brightness(1.2); }
.btn-large-jack:active { transform: scale(0.97); }

/* 🖼️ ヘッダーセクション */
.banner-container {
    width: 100%; height: 100px; /* 120pxから100pxへ縮小 */
    background: #e5e5ea no-repeat center center; background-size: cover;
    position: relative; overflow: hidden; /* アニメーションはみ出し防止 */
}

/* 🏃‍♀️💨 👦💦 追いかけっこアニメ */
.chase-animation {
    position: absolute; bottom: 30px; right: -200px;
    font-size: 22px; white-space: nowrap; user-select: none; pointer-events: none;
    animation: runChase 18s linear infinite; /* ゆっくり18秒かけて走り抜ける */
    opacity: 0.7;
}
@keyframes runChase {
    0%   { right: -200px; transform: scaleX(1) translateY(0); }
    10%  { transform: scaleX(1) translateY(-3px); }
    20%  { transform: scaleX(1) translateY(0); }
    30%  { transform: scaleX(1) translateY(-4px); }
    40%  { transform: scaleX(1) translateY(0); }
    50%  { transform: scaleX(1) translateY(-2px); }
    60%  { transform: scaleX(1) translateY(0); }
    70%  { transform: scaleX(1) translateY(-5px); }
    80%  { transform: scaleX(1) translateY(0); }
    90%  { transform: scaleX(1) translateY(-3px); }
    100% { right: 100%; transform: scaleX(1) translateY(0); }
}

.profile-header { 
    display: flex; gap: 15px; align-items: flex-start; 
    padding: 0 25px; position: relative; margin-top: -25px; /* アバターの飛び出し量を調整 */
    margin-bottom: 20px; 
}
.avatar {
    width: 90px; height: 90px; /* 110pxから90pxへ縮小 */
    border-radius: 50%;
    border: 4px solid white; box-shadow: 0 10px 30px rgba(0,0,0,0.1); object-fit: cover;
    flex-shrink: 0;
}
.profile-text-content { 
    padding-top: 35px; /* アバターの縮小に合わせて調整（50pxから35px） */
    flex: 1; 
}
#p-name { font-size: 21px; font-weight: 800; margin: 0 0 2px; color: #1c1c1e; }
#p-bio { font-size: 13px; color: #8e8e93; line-height: 1.4; white-space: pre-wrap; margin: 0; }

/* 読み込み時フェードイン */
.profile-content-ready { opacity: 0; transition: opacity 0.6s ease; }
.profile-content-ready.is-visible { opacity: 1; }

/* 🏷️ Twitter風カテゴリヘッダー */
.category-header {
    font-size: 16px; font-weight: 800; color: #1c1c1e;
    padding: 15px 25px 8px; margin: 20px 0 15px;
    border-bottom: 1px solid #eff3f4;
    position: relative;
    display: flex; align-items: flex-end;
}
.category-header::after {
    content: ""; position: absolute; bottom: -1px; left: 25px;
    width: 40px; height: 4px; background: #1d9bf0; border-radius: 50px;
}

/* 🏷️ 行ごとの任意タイトル */
.row-title {
    font-size: 14px; font-weight: 800; color: #666; /* 少し太く濃く */
    margin: 25px 35px 15px; /* 上・左右・下 の余白をしっかり確保 */
}

/* 🧩 フレキシブルiOSグリッド (行単位) */
.ios-grid {
    display: grid; gap: 12px; /* アイコン間の余白 */
    padding: 10px 35px 15px; /* 下側の余白を詰める */
}
.ios-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.ios-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ios-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; } /* 間隔を縮小 */
.ios-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ios-grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }

/* 🔽 展示省略 & 展開ロジック (タイト版) */
.category-content-wrap { position: relative; transition: 0.4s ease-out; }
.is-limited { position: relative; } 
.is-limited::after {
    /* 以前の白グラデーションを削除: 薄れている感じを無くしてくっきりさせる */
    display: none;
}

.btn-show-more {
    display: block; width: fit-content; margin: 0 auto 10px; /* 余白を最小限に */
    padding: 6px 18px; border-radius: 50px; border: 1.5px solid #1d9bf0; /* 境界線を太くくっきり */
    background: white; color: #1d9bf0; font-size: 12px; font-weight: 800; /* 文字を濃く太く */
    cursor: pointer; transition: 0.2s; box-shadow: 0 2px 8px rgba(29, 155, 240, 0.1);
}
.btn-show-more:hover { background: #1d9bf0; color: white; transform: translateY(-2px); }

.sns-item {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    cursor: pointer; text-decoration: none; text-align: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%; box-sizing: border-box; 
}
.sns-item:active { transform: scale(0.9); }

.icon-box {
    width: 62%; box-sizing: border-box; /* 追加: paddingによる幅の肥大化を完全防止 */
    background: white; border-radius: 22%; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02); /* 以前より繊細で広がる影に変更 */
    transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto; flex-shrink: 0; position: relative;
    border: 0.5px solid rgba(0,0,0,0.03); /* 極めて薄い境界線で白背景との差別化 */
}
.icon-box img {
    width: 100%; height: 100%; object-fit: cover;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.03)); /* 追加: 画像自体にも微かな影を落として輪郭を補強 */
}
.icon-box.is-book { border-radius: 6px; } /* A4判は角をシャープに */

.icon-box.text-block-mode {
    background: #f8f9fa; border: 1px solid #eee; padding: 10px 15px; 
    color: #444; font-size: 11px; font-weight: 600; text-align: center; line-height: 1.5;
    white-space: pre-wrap; word-break: break-word; /* 改行・折返し対応 */
    overflow-y: auto; /* 長すぎる場合はスクロール */
    flex-direction: column; /* 垂直方向の中央揃えを確実に */
    scrollbar-gutter: stable; /* スクロールバーの有無による左右のガタツキを防止 */
}

/* 復元：ホバーアクションとラベル指定 */
.sns-item:hover .icon-box { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.12); }

.tile-label { 
    margin-top: 10px; font-size: 11px; font-weight: 500; 
    text-align: center; color: #333; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
    width: 100%; padding: 0 4px; box-sizing: border-box;
    display: block;
}
.tile-desc { 
    margin-top: 4px; font-size: 8px; font-weight: 400; 
    text-align: center; color: #666; 
    line-height: 1.3; width: 100%; 
    max-width: 95%; margin-left: auto; margin-right: auto;
    display: block;
}

/* 🏷️ 告知バッジ (SALE, 期間限定など) - 洗練されたタグ形式 (サイズ拡大版) */
.expiry-badge {
    display: inline-block;
    background: rgba(255, 149, 0, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ff9500;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    margin: 8px 0 0px; /* autoを削除して親のalign-itemsに任せる */
    border: 0.8px solid rgba(255, 149, 0, 0.4);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 10px rgba(255, 149, 0, 0.1);
}

/* シマー（光が走る）アニメーション */
.expiry-badge::after {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
    animation: badge-shimmer 2.5s infinite ease-in-out;
}

@keyframes badge-shimmer {
    0% { left: -100%; }
    30% { left: 150%; }
    100% { left: 150%; }
}

/* クッションページ内の大きな情報用のバッジ */
.cushion-info .expiry-badge {
    font-size: 14px;
    padding: 6px 18px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* アイコン画像のフィット調整 */
.icon-box img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* 📐 本番・サイズバリアント */
.tile-1x1 { grid-column: span 1; grid-row: span 1; }
.tile-2x1 { grid-column: span 2; grid-row: span 1; }
.tile-2x2 { grid-column: span 2; grid-row: span 2; }
.tile-4x1 { grid-column: span 4; grid-row: span 1; }
.tile-4x2 { grid-column: span 4; grid-row: span 2; }
.tile-4x3 { grid-column: span 4; grid-row: span 3; }
.tile-2x3 { grid-column: span 2; grid-row: span 3; }

.tile-book_s { grid-column: span 1; grid-row: span 2; }
.tile-book_inter { grid-column: span 2; grid-row: span 3; } /* 中間サイズ */
.tile-book_m { grid-column: span 3; grid-row: span 4; } /* 3スパンに広げて存在感を調整 */

/* アイコンボックスの比率と幅指定（サイズ縮小調整） */
.sns-item.tile-1x1 > .icon-box { aspect-ratio: 1/1; width: 62%; height: auto; } 
.sns-item.tile-2x1 > .icon-box { aspect-ratio: 2/1; width: 85%; height: auto; border-radius: 16px; }
.sns-item.tile-2x2 > .icon-box { aspect-ratio: 1/1; width: 85%; height: auto; border-radius: 20px; }
.sns-item.tile-4x1 > .icon-box { aspect-ratio: 4/1; width: 90%; height: auto; border-radius: 12px; }
.sns-item.tile-4x2 > .icon-box { aspect-ratio: 2/1; width: 90%; height: auto; border-radius: 20px; }
.sns-item.tile-4x3 > .icon-box { aspect-ratio: 4/3; width: 92%; height: auto; border-radius: 24px; }
.sns-item.tile-2x3 > .icon-box { aspect-ratio: 2/2.828; width: 85%; height: auto; border-radius: 20px; }

.sns-item.tile-book_s > .icon-box,
.sns-item.tile-book_inter > .icon-box,
.sns-item.tile-book_m > .icon-box { aspect-ratio: 1 / 1.414; height: auto; border-radius: 6px; }

/* ↔️ 本棚風・横スクロール */
.horizontal-scroll {
    display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory; 
    padding: 10px 35px 40px; /* 左右に35pxの余裕、タイトルとの間に10px */
    scroll-padding-inline: 35px; /* スクロールスナップ位置の調整（読み込み時のズレ防止） */
    gap: 24px; /* アイコンどうしの間隔をさらに拡大 */
    cursor: grab;
    justify-content: flex-start; /* 確実に左端から開始させる */
    align-items: flex-start; 
    scrollbar-width: auto; /* Firefox対策 */
    scrollbar-color: #c7c7cc transparent;
    scroll-behavior: smooth;
}
.horizontal-scroll:active { cursor: grabbing; }
.horizontal-scroll::-webkit-scrollbar { height: 8px; /* PCで掴みやすい太さに */ }
.horizontal-scroll::-webkit-scrollbar-thumb { background: #c7c7cc; border-radius: 10px; }
.horizontal-scroll::-webkit-scrollbar-track { background: #f2f2f7; border-radius: 10px; } /* トラック背景も追加 */

/* 本棚モード時の各アイテムとアイコン枠のサイズ拡大 */
.horizontal-scroll .sns-item {
    flex: 0 0 auto; /* 幅は中身（サイズクラス）に任せる */
    scroll-snap-align: start;
    min-width: 80px;
}
.horizontal-scroll .sns-item.tile-1x1 { width: 90px; }
.horizontal-scroll .sns-item.tile-2x1 { width: 180px; }
.horizontal-scroll .sns-item.tile-2x2 { width: 180px; }
.horizontal-scroll .sns-item.tile-4x1 { width: 300px; }
.horizontal-scroll .sns-item.tile-4x2 { width: 300px; }
.horizontal-scroll .sns-item.tile-4x3 { width: 320px; }
.horizontal-scroll .sns-item.tile-2x3 { width: 140px; }

/* 本棚モードでのA4サイズ調整（存在感を出す） */
.horizontal-scroll .sns-item.tile-book_s { width: 100px; }
.horizontal-scroll .sns-item.tile-book_inter { width: 160px; }
.horizontal-scroll .sns-item.tile-book_m { width: 220px; }

.horizontal-scroll .icon-box {
    width: 100%; /* 本棚モードでは各アイテムの幅を100%使う */
}

/* 📢 告知カード (超スリム・スマートウィジェット) */
#promo-section { padding: 5px 20px 10px; }
.promo-card {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
    transition: 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
    display: flex;
    flex-direction: column;
}
.promo-card:active { transform: scale(0.98); }

.promo-card-image {
    width: 100%;
    aspect-ratio: 24 / 9; /* さらにスリムな極細比率 */
    overflow: hidden;
    margin-bottom: 0;
}
.promo-card-image img { width: 100%; height: 100%; object-fit: cover; }

.promo-card-body {
    padding: 12px 15px 10px;
    text-align: center;
}

#promo-title {
    font-size: 18px; font-weight: 900; color: #1c1c1e;
    margin: 0 0 2px; letter-spacing: -0.4px;
}
#promo-desc {
    font-size: 11px; color: #828287;
    margin-bottom: 0; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; /* 1行に制限 */
}

/* カード下部のワイド誘導エリア */
.promo-footer {
    background: rgba(0, 122, 255, 0.04);
    padding: 10px;
    border-top: 0.5px solid rgba(0, 122, 255, 0.08);
    color: #007aff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.5px;
}

/* 告知バッジ（ウィジェット内・高視認性アップグレード） */
.promo-card .expiry-badge {
    position: absolute;
    top: 10px; right: 10px;
    margin: 0;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ff9500, #ff5e00);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 94, 0, 0.4);
    font-weight: 900;
    backdrop-filter: none;
    animation: promo-badge-pop 2s infinite ease-in-out;
}

@keyframes promo-badge-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* シマー（光が走る）を白バッジ用に強調 */
.promo-card .expiry-badge::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
}
.promo-btn-capsule:hover { background: #e5e5ea; transform: translateY(-2px); }

/* 告知バッジ（ウィジェット内） */
.promo-card .expiry-badge {
    margin: 0 auto 10px;
    display: table;
}

.promo-btn-capsule {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0.5px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-size: 10px;
    font-weight: 800;
    width: fit-content;
    transition: 0.2s;
    text-align: center;
}
.promo-btn-capsule:hover { background: rgba(255,255,255,0.25); transform: translateX(3px); }

/* 📚 ストア選択ポップアップスタイル */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px);
    z-index: 20000; display: flex; align-items: flex-end; justify-content: center;
    visibility: hidden; opacity: 0; transition: 0.3s;
}
.modal-overlay.visible { visibility: visible; opacity: 1; }
.modal-content {
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    width: 100%; max-width: 500px; padding: 30px 25px 50px;
    border-radius: 32px 32px 0 0; transform: translateY(100%); transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.visible .modal-content { transform: translateY(0); }

.store-link-btn {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; background: white; margin-bottom: 12px;
    border-radius: 18px; text-decoration: none; color: #1c1c1e; font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); transition: 0.2s;
}
.store-link-btn:active { background: #f2f2f7; transform: scale(0.98); }

.btn-close-modal {
    width: 100%; padding: 16px; margin-top: 15px; background: #f2f2f7;
    border: none; border-radius: 18px; font-weight: bold; color: #8e8e93; cursor: pointer;
}

/* 🛒 クッション内ストアグリッド (メインサイトと完全一致) */
.cushion-stores-grid {
    display: grid; 
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px auto 30px;
    width: 100%;
    max-width: 430px; /* 430pxに戻す */
}
/* コンテンツ全体を画像の幅に縛るためのラッパー（app.jsで追加） */
.cushion-alignment-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}
.cushion-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch; /* 親の幅いっぱいに広げる */
}
.cushion-store-item {
    display: flex; flex-direction: column; align-items: center; text-decoration: none;
    width: 100%; transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.cushion-store-item:hover .cushion-store-icon-wrapper { 
    transform: translateY(-5px); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.12); 
}
.cushion-store-item:active { transform: scale(0.9); }

/* 💎 アイコンのデザイン (メインサイトの .icon-box と完全同期) */
.cushion-store-icon-wrapper {
    width: 62%; /* デフォルト(1x1)は62% */
    margin: 0 auto;
    position: relative;
    background: white;
    border-radius: 22%; /* 1x1は%指定 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
    border: 0.5px solid rgba(0,0,0,0.03);
    overflow: hidden;
    transition: 0.3s;
}

/* タイルサイズごとに幅と角丸（絶対値）をメインサイトに合わせる */
.tile-2x1 .cushion-store-icon-wrapper { width: 85%; border-radius: 16px; }
.tile-4x1 .cushion-store-icon-wrapper { width: 90%; border-radius: 12px; }
.tile-4x2 .cushion-store-icon-wrapper { width: 90%; border-radius: 20px; }

/* 1x1を基準とした高さの強制固定 */
.cushion-store-icon-wrapper::before {
    content: "";
    display: block;
    padding-bottom: 100%; /* 正方形を作る */
}

.cushion-store-icon-content {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.cushion-store-icon-content img { width: 100%; height: 100%; object-fit: cover; }

/* 横長(2x1, 4x1)の高さを調整 (メインサイトの aspect-ratio 2/1, 4/1等に近似) */
.tile-2x1 .cushion-store-icon-wrapper::before { padding-bottom: 45%; }
.tile-4x1 .cushion-store-icon-wrapper::before { padding-bottom: 22%; }

.cushion-store-label {
    margin-top: 8px; font-size: 11px; font-weight: 500; color: #333;
    text-align: center; width: 100%; opacity: 0.9;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding: 0 4px; box-sizing: border-box;
}

/* 🎈 SNSポップオーバー (アイコンから展開) */
.modal-overlay.popover-mode {
    background: transparent; /* 背景グレーなし */
    backdrop-filter: none; /* ぼかしなし */
    align-items: center; justify-content: center;
}
.sns-popover {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 18px; /* 少し余裕を持たせる */
    width: 320px; /* 4列が綺麗に並ぶ幅に拡大 */
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 20001;
    /* transform-origin: bottom center; 削除: JSで動的に設定 */
    animation: drawer-reveal 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1) forwards;
    border: 1px solid rgba(255,255,255,0.8);
}

@keyframes drawer-reveal {
    0% { opacity: 0; transform: scale(0.7) translateY(var(--reveal-start-y, 20px)); } 
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 📚 ポップオーバー内のプレミアム・グリッド */
.pop-stores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4列に統一 */
    gap: 12px;
    margin-bottom: 20px;
    padding: 5px;
    align-items: start;
}

.pop-store-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.pop-store-item:active { transform: scale(0.9); }

.pop-store-icon {
    width: 80%; /* 占有率を一律80%に下げて余白を確保 */
    background: white; border-radius: 14px; /* 固定値: 1x1と同じ婉曲を維持 */
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    overflow: hidden; margin-bottom: 8px;
    border: 0.5px solid rgba(0,0,0,0.03);
    position: relative;
    transition: 0.3s;
}
.pop-store-icon img { width: 100%; height: 100%; object-fit: cover; }

.pop-store-label {
    font-size: 10px; font-weight: 800; color: #1c1c1e;
    text-align: center; width: 100%;
    line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ポップオーバー内のサイズバリアント - 境界線を揃えるための精密な比率 */
.pop-store-item.tile-1x1 .pop-store-icon { aspect-ratio: 1/1; }
.pop-store-item.tile-2x1 { grid-column: span 2; }
.pop-store-item.tile-2x1 .pop-store-icon { aspect-ratio: 2.3 / 1; width: 80%; } 
.pop-store-item.tile-3x1 { grid-column: span 3; }
.pop-store-item.tile-3x1 .pop-store-icon { aspect-ratio: 3.6 / 1; width: 80%; }
.pop-store-item.tile-4x1 { grid-column: span 4; }
.pop-store-item.tile-4x1 .pop-store-icon { aspect-ratio: 5 / 1; width: 80%; }

/* ホバー時の浮き上がり */
.pop-store-item:hover .pop-store-icon { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }

@keyframes drawer-reveal {
    0% { opacity: 0; transform: scale(0.7) translateY(20px); } 
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.sns-popover .pop-title {
    font-size: 13px; font-weight: 800; color: #1c1c1e;
    margin-bottom: 12px; text-align: center;
    border-bottom: 1px solid #eee; padding-bottom: 8px;
}
.pop-store-btn {
    display: block; padding: 12px; background: white; margin-bottom: 8px;
    border-radius: 12px; text-decoration: none; color: #1c1c1e; font-size: 14px;
    font-weight: bold; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: 0.2s; text-align: center;
}
.pop-store-btn:active { transform: scale(0.95); background: #f2f2f7; }
.pop-close-btn {
    width: 100%; border: none; background: none; color: #8e8e93;
    font-size: 12px; font-weight: bold; margin-top: 5px; cursor: pointer;
}

/* 🔞 R18用ぼかし効果 */
.adult-blurred {
    filter: blur(8px);
    pointer-events: none; /* クリック無効化 */
    transition: filter 0.5s ease;
}
