/**
 * スクラッチショップ - スタイルシート
 * Scratch素材集の独立サービス
 * 子供向けフレンドリーで楽しいデザイン
 */

/* ====================================== */
/* フルスクリーンスクロールシステム */
/* ====================================== */

/* Safari(WebKit)のルビ描画差の補正（本体style.cssと同一の対策）。
   WebKitはルビ(rt)を漢字から離して描画し行高も膨らむため、
   WebKit限定(@supportsのnamed-image判定)でrtを基底側へ引き寄せる */
@supports (background: -webkit-named-image(i)) {
  rt {
    margin-bottom: -0.5em;
  }
}

/* ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
    margin: 0;
    padding: 0;
}

body.fullscreen-body {
    font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: #333;
}

/* ルビ（読み仮名）非表示モード - スクラッチモンスターと共通設定 */
body.ruby-hidden rt {
    display: none;
}

/* 🆕 Screen 1/3はスクロール許可 */
/* Screen 1: ヒーローページ（使い方ガイド、特徴、FAQ等の長いコンテンツ） */
/* Screen 3: ギャラリー + フッター */
/* 重要: htmlのみheight: 100vhを設定。bodyはautoにしてコンテンツに合わせて拡張させる */
/* これによりbodyがviewportを超えた分、htmlがスクロール可能になる */
html.screen-1-active,
html.screen-3-active {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* bodyはheight: autoでコンテンツに合わせて拡張 */
body.screen-1-active,
body.screen-3-active {
    height: auto;
    min-height: 100vh;
    overflow-y: visible;
    overflow-x: hidden;
}

/* Screen 2: 選択画面（フルスクリーン固定、スクロールなし、フッターなし） */
html.screen-2-active {
    height: 100vh;
    overflow: hidden; /* スクロール無効 */
}

body.screen-2-active {
    height: 100vh;
    overflow: hidden; /* スクロール無効 */
}

/* Screen 2: フッター非表示 */
body.screen-2-active .sozai-footer {
    display: none !important;
}

/* Screen 2: Screen 3（Gallery）を完全に非表示（遷移時のちらつき防止） */
body.screen-2-active #screen-gallery {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

body.screen-2-active .gallery-bg {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Screen 2: 背景を完全に固定（遷移時の巨大化防止） */
body.screen-2-active .selection-bg {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;  /* GPU安定化を強制 */
    transition: none !important;          /* 遷移中はアニメーション無効 */
    contain: layout size style !important; /* レイアウト隔離を強制 */
}

/* Screen 3: 背景を完全に固定（遷移時の巨大化防止） */
body.screen-3-active .gallery-bg {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;  /* GPU安定化を強制 */
    transition: none !important;          /* 遷移中はアニメーション無効 */
    contain: layout size style !important; /* レイアウト隔離を強制 */
}

#sozai-app.fullscreen-container {
    width: 100vw;
    min-height: 100vh;
    overflow-y: auto;  /* スクロール有効（フッター表示のため） */
    overflow-x: hidden;
    background: white;
}


.fullscreen-section {
    width: 100vw;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.scrollable-section {
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
}

/* ヘッダー */
.sozai-header {
    background: transparent;
    color: white;
    padding: 1rem 0;
    position: absolute;
    top: 0;
    z-index: 100;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Screen 1（エントランス）ではヘッダー非表示 */
.sozai-header[data-current-screen="1"] {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-100%);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
}

.logo-image {
    height: 70px;
    width: auto;
    margin-top: -15px;
    object-fit: contain;
}

.logo-sub {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-left: 0.5rem;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: all 0.3s;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.nav-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.user-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#user-info {
    font-weight: 500;
}

.hero-badge {
    color: #ffd700;
    margin-left: 0.5rem;
}

.login-btn {
    background: white;
    color: #ff6b6b;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ヒーローセクション */
.hero-section {
    background: linear-gradient(180deg, #fff5f0 0%, white 100%);
    padding: 3rem 1rem 1.5rem 1rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.hero-emoji {
    font-size: 3rem;
    animation: sparkle 1.5s infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(10deg); }
}

.hero-subtitle {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.badge {
    background: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    transition: all 0.3s;
}

.badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.badge-free {
    border: 2px solid #4ecdc4;
    color: #4ecdc4;
}

.badge-premium {
    border: 2px solid #ffd700;
    color: #ff9a56;
}

.badge-safe {
    border: 2px solid #667eea;
    color: #667eea;
}

.badge-edu {
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
}

.hero-cta {
    margin-top: 2rem;
}

.cta-text {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

/* ====================================== */
/* スクリーンレイヤー（縦スタックレイアウト） */
/* ====================================== */

/* メインコンテンツセクション - Screen 2-3共通の背景 */
#main-content {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    height: 100%; /* コンテンツの高さに応じて伸びる */
    background-image: url("../../image/background2.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* background-attachment: fixed; 削除 - GPUコンポジターバグ回避 */
    /* GPUレイヤー最適化 */
    will-change: transform;
    transform: translateZ(0);
}

/* Screen 1-3の共通レイヤースタイル - 絶対配置でフェード切り替え */
.screen-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    opacity: 0;
    visibility: hidden; /* display:noneの代わりにvisibilityを使用 */
    pointer-events: none;
    z-index: 1; /* デフォルトのz-index */
    transition: opacity 0.5s ease, visibility 0s 0.5s; /* visibilityは遅延して非表示 */
    /* 🆕 非アクティブなScreenを高さゼロに折りたたむ（白い空間対策） */
    max-height: 0;
    overflow: hidden;
    /* ⚠️ GPU最適化は非アクティブ時は無効（VRAM残存対策） */
    will-change: auto;
    transform: none;
}

.screen-layer.active {
    opacity: 1;
    visibility: visible; /* 即座に表示 */
    pointer-events: auto;
    z-index: 10; /* アクティブな画面を前面に */
    transition: opacity 0.5s ease, visibility 0s 0s; /* visibilityは即座に表示 */
    /* 🆕 アクティブなScreenはビューポート高さで固定（スクロール可能にするため） */
    height: 100vh;
    max-height: 100vh;
    overflow: hidden; /* 子要素がスクロール担当 */
    /* ✅ アクティブ時のみGPU最適化を有効化（パフォーマンスとVRAM管理の両立） */
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* 🔧 Screen 3: bodyスクロールと統一（フッター表示問題対策） */
#screen-gallery.active {
    height: auto;
    max-height: none;
    overflow: visible;
    position: relative; /* absoluteからrelativeに変更（bodyフローに参加） */
}

/* 🔧 Screen 1: 長いコンテンツをスクロール可能に（使い方ガイド、特徴、FAQ等） */
#screen-entrance.active {
    height: auto;
    max-height: none;
    overflow: visible;
    position: relative; /* absoluteからrelativeに変更（bodyフローに参加） */
}

/* ====================================== */
/* Screen 1: エントランス画面 */
/* ====================================== */

#screen-entrance {
    overflow: visible; /* 🔧 hiddenからvisibleに変更（スクロール有効化） */
}

.entrance-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    /* ⚠️ GPU最適化はJavaScript側で動的管理（VRAM残存対策） */
}

.entrance-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.entrance-title {
    font-size: 72px;
    font-weight: bold;
    color: white;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.5), -2px -2px 4px rgba(255,255,255,0.3);
    letter-spacing: 8px;
    animation: entranceTitlePulse 2s ease-in-out infinite;
}

/* Screen 1: タイトルテキストスタイル（sokun側と同じデザイン） */
.main-title {
    color: #fff !important;
    font-family: "Alfa Slab One" !important;
    font-weight: 100 !important;
    text-shadow: 5px 5px 2px #000000, -5px 5px 2px #000000, 5px -5px 2px #000000, -5px -5px 2px #000000, 5px 0px 2px #000000, 0px 5px 2px #000000, -5px 0px 2px #000000, 0px -5px 2px #000000 !important;
    font-size: 82px !important;
}

.sub-title {
    font-family: 'Dela Gothic One' !important;
    color: #000 !important;
    line-height: 1 !important;
    text-shadow:
        1px 1px 1px #ffffff,
        -1px 1px 1px #ffffff,
        1px -1px 1px #ffffff,
        -1px -1px 1px #ffffff,
        1px 0px 1px #ffffff,
        0px 1px 1px #ffffff,
        -1px 0px 1px #ffffff,
        0px -1px 1px #ffffff !important;
    letter-spacing: 3px !important;
    font-weight: 100 !important;
    font-size: 41px !important;
    margin-bottom: 20px !important;
}

/* Screen 1: ロゴ「ソザイバ」（1文字ずつの画像をジグザグに並べる）
   元のロゴ画像（1400x396）での各文字の位置を % で置き、上下に互い違いにずらして傾ける */
.sozaiba-logo {
    position: relative;
    width: clamp(260px, 48vw, 960px);
    max-width: 90vw;
    aspect-ratio: 1400 / 396;
    margin: 2% 0 3%;
    filter: drop-shadow(0 6px 10px rgba(40, 10, 60, 0.35));
}

.sozaiba-logo img {
    position: absolute;
    height: auto;
}

.sozaiba-logo-so { left: 0.07%; top: 7.32%; width: 25.21%; transform: translateY(-9%) rotate(-7deg); }
.sozaiba-logo-za { left: 24%; top: 3.28%; width: 27.71%; transform: translateY(9%) rotate(5deg); }
.sozaiba-logo-i { left: 47.93%; top: 4.8%; width: 24.29%; transform: translateY(-9%) rotate(-5deg); }
.sozaiba-logo-ba { left: 69.36%; top: 0.25%; width: 30.57%; transform: translateY(9%) rotate(7deg); }

.catch-copy {
    -webkit-text-fill-color: #f9d25d !important;
    line-height: 0 !important;
    font-family: 'M PLUS Rounded 1c' !important;
    text-shadow:
        2px 2px 1px #000000,
        -2px 2px 1px #000000,
        2px -2px 1px #000000,
        -2px -2px 1px #000000,
        2px 0px 1px #000000,
        0px 2px 1px #000000,
        -2px 0px 1px #000000,
        0px -2px 1px #000000 !important;
    font-size: 22px !important;
    margin-bottom: 40px !important;
}

@keyframes entranceTitlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.entrance-button {
    background: none;
    border: none;
    cursor: pointer;
    position: relative !important;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.entrance-button:hover {
    transform: scale(1.1) translateY(-5px);
    filter: brightness(1.2) drop-shadow(0 10px 20px rgba(255,200,0,0.5));
}

.entrance-button-img {
    width: 150px !important;
    height: auto !important;
    display: block !important;
}

.entrance-button img {
    width: 150px;
    height: auto;
}

/* 指アイコン（sokun側と同じデザイン） */
.enter-finger {
position: absolute;
    right: 16px;
    bottom: 2px;
    width: 45px !important;
    height: auto !important;
    display: block !important;
    animation: finger-bounce 1.5s ease-in-out infinite;
}

@keyframes finger-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes entranceButtonFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ====================================== */
/* Screen 2: 選択画面 */
/* ====================================== */

#screen-selection {
    overflow: hidden; /* スクロール無効 */
    position: absolute; /* フルスクリーン固定表示 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
}

.help-button {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    transition: transform 0.3s ease;
}

.help-button:hover {
    transform: scale(1.1) rotate(5deg);
}

.help-button img {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.selection-bg {
    position: fixed; /* 親要素に依存しない固定配置 */
    inset: 0;        /* top/right/bottom/left: 0 の短縮形 */
    /*
     * 100vwはスクロールバー幅を含むため使用しない
     * inset: 0 で実際のビューポートサイズに自動適合
     */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 1;
    overflow: hidden;
    /* GPU合成レイヤー化（scale()なしで安定） */
    transform: translate3d(0, 0, 0);
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* 親レイアウト変更からの隔離 */
    contain: layout size style;
    /* サイズ変更を防止 */
    box-sizing: border-box;
}

.selection-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    height: 100%; /* min-height: 100vh から変更 - 親の100vhに完全に合わせる */
    overflow: hidden; /* はみ出しを完全に防止 */
}

.welcome-image {
    max-width: 500px;
    width: 90%;
    height: auto;
    margin-top: -25px;
    animation: welcomeBounce 2s ease-in-out infinite;
}

@keyframes welcomeBounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-15px) rotate(3deg); }
}

.selection-title {
    font-size: 32px;
    font-weight: bold;
    color: #2c1810;
    margin: 7px 0 0;
    padding: 11px 0 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    -webkit-text-fill-color: #f9d25d !important;
    line-height: 0 !important;
    font-family: 'M PLUS Rounded 1c' !important;
    text-shadow: 2px 2px 1px #000000, -2px 2px 1px #000000, 2px -2px 1px #000000, -2px -2px 1px #000000, 2px 0px 1px #000000, 0px 2px 1px #000000, -2px 0px 1px #000000, 0px -2px 1px #000000 !important;
}

.selection-buttons {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.selection-button {
    background-image: url("../../image/buttonFlame.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    position: relative;
    padding: 40px 13px;
    width: 180px;
    height: 96px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    gap:5px;
}

.selection-button span{
    font-size: 38px;
    -webkit-text-fill-color: #f9d25d;
    font-weight: bold;
    line-height: 1;
    font-family: 'M PLUS Rounded 1c';
    text-shadow: 2px 2px 1px #000000, -2px 2px 1px #000000, 2px -2px 1px #000000, -2px -2px 1px #000000, 2px 0px 1px #000000, 0px 2px 1px #000000, -2px 0px 1px #000000, 0px -2px 1px #000000;
    /* ルビを絶対位置にするための基準 */
    position: relative;
}

/* ルビのスタイル（タブボタン用） - 絶対位置で本文の高さに影響を与えない */
.selection-button span ruby {
    /* ruby要素自体はインライン */
    position: relative;
}

.selection-button span ruby rt {
    font-size: 15px;
    font-weight: normal;
    -webkit-text-fill-color: #f9d25d;
    text-shadow: 1px 1px 0px #000000, -1px 1px 0px #000000, 1px -1px 0px #000000, -1px -1px 0px #000000;
    /* 絶対位置で漢字の上に配置、本文の高さに影響しない */
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.selection-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.selection-button:hover {
    transform: scale(1.15) rotate(5deg);
    filter: brightness(1.2) drop-shadow(0 10px 30px rgba(255,215,0,0.6));
}

.selection-button:hover::before {
    width: 200px;
    height: 200px;
}

.selection-button img {
    width: 50px;
    height: auto;
}

#searchSubmitButtonGallery{
    background: transparent;
    border: none;
    height: 35px;
}

#searchSubmitButtonGallery img{
    height: 36px;
}

.search-form-wrapper {
    width: 100%;
    max-width: 400px;
    margin-top: -10px;
}

.search-form-bg {
    background-image: url("../../image/searchForm.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    padding: 5px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 19px 0 5px;
}

.search-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.search-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#searchInputSelection {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 18px;
    outline: none;
    padding: 8px;
}

#searchSubmitButton {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 50px;
}

#searchSubmitButton img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.search-form-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 15px;
}

.search-form-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.search-form-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-form-input:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

/* ====================================== */
/* 右上メニューボタン（Screen 2用） */
/* ====================================== */

.right-menu-selection {
    position: absolute;
    right: 3.4rem;
    top: 104px;
    z-index: 50;
    display: none !important; /* デフォルト非表示 */
    flex-direction: column;
    gap: 15px;
    pointer-events: auto;
}

/* Screen 2がアクティブ時のみ表示 */
#screen-selection.active .right-menu-selection {
    display: flex !important;
}

/*
 * 右上の2ボタン（Screen 2・3 共通）: ゲームのボタンのような立体の板（2026-10-30 ヒロ）
 * - 太いふち＋下の厚み（box-shadow の 0 5px 0）で「押せる板」に見せ、押すと沈む
 * - アイコンは丸いメダルに入れる（img に背景・ふちを付けるだけ）
 * - ななめの光の帯がときどき走る（::before）。右はしに矢じるし（::after）
 * - 色は --btn-* で持つ: ブレイバー＝金→オレンジ、クラフト＝緑
 */
.scratch-monster-button,
.shop-button {
    --btn-edge: #6b3300;   /* ふち・厚み・文字のふちどり */
    --btn-ink: #4a2200;    /* 役割の一言 */
    --btn-face: linear-gradient(180deg, #fff6b8 0%, #ffd84a 34%, #ffb300 66%, #ff8a00 100%);
    --btn-medal: radial-gradient(circle at 50% 32%, #6a5be0 0%, #2d1f86 62%, #1a1152 100%);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    pointer-events: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    width: 236px;
    height: 74px;
    padding: 0 32px 0 9px;
    box-sizing: border-box;
    border: 3px solid var(--btn-edge);
    border-radius: 16px;
    background: var(--btn-face);
    box-shadow:
        0 5px 0 var(--btn-edge),
        0 10px 18px rgba(0, 0, 0, 0.35),
        inset 0 3px 0 rgba(255, 255, 255, 0.7),
        inset 0 -5px 0 rgba(0, 0, 0, 0.12);
    color: #fff;
    text-decoration: none;
    text-align: left;
    line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.shop-button-2 {
    --btn-edge: #0b4a26;
    --btn-ink: #06351b;
    --btn-face: linear-gradient(180deg, #d4ffe2 0%, #5ee893 34%, #18c45c 66%, #079447 100%);
    --btn-medal: radial-gradient(circle at 50% 32%, #ffffff 0%, #e3f8ff 60%, #a6e1ff 100%);
}

/* ななめの光の帯（5秒に1回。クラフトは半分ずらして交互に光る） */
.scratch-monster-button::before,
.shop-button::before {
    content: "";
    position: absolute;
    top: -30%;
    bottom: -30%;
    left: 0;
    width: 38%;
    z-index: 2;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 38%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0.3) 62%, rgba(255, 255, 255, 0) 100%);
    transform: translateX(-140%) skewX(-22deg);
    animation: sozaiba-btn-shine 5s ease-in-out infinite;
    pointer-events: none;
}

.shop-button-2::before {
    animation-delay: 2.5s;
}

@keyframes sozaiba-btn-shine {
    0%, 72% { transform: translateX(-140%) skewX(-22deg); }
    92%, 100% { transform: translateX(300%) skewX(-22deg); }
}

/* 右はしの矢じるし（丸の中に白い「＞」） */
.scratch-monster-button::after,
.shop-button::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 8px;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    border-radius: 50%;
    background: var(--btn-edge) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M8 5.5l4.5 4.5L8 14.5' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
    transition: transform 0.15s ease;
}

.scratch-monster-button:hover,
.shop-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.06) saturate(1.1);
    box-shadow:
        0 7px 0 var(--btn-edge),
        0 14px 22px rgba(0, 0, 0, 0.38),
        inset 0 3px 0 rgba(255, 255, 255, 0.7),
        inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}

.scratch-monster-button:hover::after,
.shop-button:hover::after {
    transform: translateX(3px);
}

/* 押すと厚みのぶん沈む */
.scratch-monster-button:active,
.shop-button:active {
    transform: translateY(4px);
    filter: none;
    box-shadow:
        0 1px 0 var(--btn-edge),
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 3px 0 rgba(255, 255, 255, 0.7),
        inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}

.scratch-monster-button:focus-visible,
.shop-button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* 動きを減らす設定の人には、光の帯を走らせない */
@media (prefers-reduced-motion: reduce) {
    .scratch-monster-button::before,
    .shop-button::before {
        animation: none;
        display: none;
    }
}

.button-arrow {
    width: 40px !important;
    height: auto !important;
    flex-shrink: 0;
}

/* アイコンのメダル（正方形にして丸く切り、絵は縮めて中に収める） */
.button-icon {
    width: 50px !important;
    height: auto !important;
    aspect-ratio: 1;
    object-fit: contain;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 4px;
    border: 3px solid var(--btn-edge);
    border-radius: 50%;
    background: var(--btn-medal);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.button-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    line-height: 1.3;
    color: var(--btn-ink);
}

/* ====================================== */
/* Screen 3: ギャラリー画面 */
/* ====================================== */

#screen-gallery {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;  /* 🔧 コンテンツに合わせて高さ可変（bodyスクロールと統一） */
    min-height: 100%;
    overflow: visible;  /* 🔧 内部スクロール無効（bodyレベルでスクロール） */
    /* 背景は.gallery-bgレイヤーで表示（スクロール対応） */
}

/* Screen 3: 木目調テクスチャ背景（繰り返し） */
.gallery-bg {
    display: block !important; /* 強制表示（JS非表示対策） */
    position: fixed;  /* 親要素に依存しない固定配置 */
    inset: 0;         /* top/right/bottom/left: 0 の短縮形 */
    /*
     * 100vwはスクロールバー幅を含むため使用しない
     * inset: 0 で実際のビューポートサイズに自動適合
     */
    background-size: auto; /* 繰り返し用：元サイズを維持 */
    background-position: top left;
    background-repeat: repeat; /* 木目テクスチャを繰り返し */
    z-index: 1;
    pointer-events: none; /* スクロールイベントをブロックしない */
    overflow: hidden;
    /* GPU合成レイヤー化（scale()なしで安定） */
    transform: translate3d(0, 0, 0);
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* 親レイアウト変更からの隔離 */
    contain: layout size style;
    box-sizing: border-box;
    opacity: 1;
}

.gallery-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-top: 80px; /* ヘッダー分のスペース */
}

/* 右上ボタン（Screen 3） */
.right-menu-gallery {
    position: absolute;
    right: calc(3.4rem - 15px); /* スクロールバー幅(15px)分を相殺 */
    top: 104px;
    z-index: 50;
    display: none !important; /* デフォルト非表示 */
    flex-direction: column;
    gap: 15px;
    pointer-events: auto;
}

/* Screen 3がアクティブ時のみ表示 */
#screen-gallery.active .right-menu-gallery {
    display: flex !important;
}

/*
 * 右上ボタン（Screen 2・3）: 1100px 以下では右上に重ねず、ヘッダーのすぐ下に横並びで置く（2026-10-09）
 * - 右上に absolute で置いたままだと、1100px 以下でカテゴリーのピル・検索・画像/音声ボタン・「ようこそ！」に重なる
 *   （800px で音声ボタン、375px でピルと検索フォームの上に乗っていた）
 * - 流れに入れるので、ヘッダーの下の余白（今までは .gallery-content の padding-top）はボタンの列が持つ。
 *   ボタンが隠れても（来たサービスのボタンは return-link.js が隠す・ENABLE_EXTERNAL_LINKS=false）余白は残る
 * - 下ではなく上に置くのは、左下に固定の「← 修行にもどる」（return-link.js の .sm-return）と重ねないため。
 *   ボタンの列は index.php でフィルターより前にあるので、CSS だけではフィルターの下へ回せない
 * ⚠️ 指定は必ず `#screen-*.active` から書く。768px 以下で隠すつもりの `.right-menu-*{display:none !important}` が
 *    上の `#screen-*.active … {display:flex !important}` に詳細度で負けて、2025-11 から効いていなかった
 */
@media (max-width: 1100px) {
    /* Screen 2 は 100vh・overflow:hidden の箱。ボタンの列を除いた残りで中身を上下中央に置く */
    #screen-selection.active {
        display: flex;
        flex-direction: column;
    }

    #screen-selection.active .selection-content {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    #screen-selection.active .right-menu-selection,
    #screen-gallery.active .right-menu-gallery {
        position: relative;
        top: auto;
        right: auto;
        flex: none;
        flex-direction: row;
        justify-content: flex-end;
        gap: 10px;
        width: 100%;
        max-width: 1200px; /* .filters-container とそろえる */
        margin: 0 auto;
        padding: 86px 1rem 0; /* ヘッダーの下 */
        box-sizing: border-box;
    }

    #screen-gallery.active .gallery-content {
        padding-top: 0;
    }
}

/* ヘッダーの高さは 768px・480px で変わる（.gallery-content の padding-top 80/70/60 と同じ段） */
@media (max-width: 768px) {
    #screen-selection.active .right-menu-selection,
    #screen-gallery.active .right-menu-gallery {
        padding-top: 74px;
    }
}

@media (max-width: 480px) {
    #screen-selection.active .right-menu-selection,
    #screen-gallery.active .right-menu-gallery {
        padding-top: 64px;
    }
}

/* 220px のボタン2つが並ばない幅では、幅を分け合う小さいボタンにする */
@media (max-width: 600px) {
    #screen-selection.active .right-menu-selection,
    #screen-gallery.active .right-menu-gallery {
        gap: 8px;
    }

    #screen-selection.active .right-menu-selection a,
    #screen-gallery.active .right-menu-gallery a {
        flex: 1 1 0;
        min-width: 0;
        max-width: 260px;
        width: auto;
        height: auto;
        min-height: 56px;
        padding: 6px 26px 6px 7px; /* 右は矢じるしのぶん */
        gap: 6px;
        border-radius: 13px;
        font-size: 13px;
    }

    #screen-selection.active .right-menu-selection a img,
    #screen-gallery.active .right-menu-gallery a img {
        width: 36px !important;
        padding: 2px;
        border-width: 2px;
    }

    #screen-selection.active .right-menu-selection a::after,
    #screen-gallery.active .right-menu-gallery a::after {
        right: 6px;
        width: 16px;
        height: 16px;
        margin-top: -8px;
    }
}

/* 2つ並びで幅が足りなくなったら、矢じるしをやめて文字に場所をゆずる（2026-10-30） */
@media (max-width: 440px) {
    #screen-selection.active .right-menu-selection a,
    #screen-gallery.active .right-menu-gallery a {
        padding-right: 7px;
    }

    #screen-selection.active .right-menu-selection a::after,
    #screen-gallery.active .right-menu-gallery a::after {
        display: none;
    }
}

/* 「スクラッチがもっと」（9文字）が1行に入るように。344px 以上で入る */
@media (max-width: 400px) {
    #screen-selection.active .right-menu-selection a,
    #screen-gallery.active .right-menu-gallery a {
        padding: 6px;
        gap: 4px;
        font-size: 12px;
    }

    #screen-selection.active .right-menu-selection a img,
    #screen-gallery.active .right-menu-gallery a img {
        width: 28px !important;
        padding: 1px;
    }

    /* 「コードブレイバー」（8文字）が 344px 幅のボタンに入るように */
    #screen-selection.active .right-menu-selection .button-service,
    #screen-gallery.active .right-menu-gallery .button-service {
        font-size: 12px;
        letter-spacing: 0;
    }
}

/* それより狭い幅（320px など）は縦に積んで、文を1行にする */
@media (max-width: 343.98px) { /* 端数の幅（343.5px など）も含める */
    #screen-selection.active .right-menu-selection,
    #screen-gallery.active .right-menu-gallery {
        flex-direction: column;
        gap: 6px;
    }

    #screen-selection.active .right-menu-selection a,
    #screen-gallery.active .right-menu-gallery a {
        flex: none;
        max-width: none;
        min-height: 44px;
        padding-right: 24px;
    }

    /* 縦に積むと横幅が空くので、矢じるしをもどす */
    #screen-selection.active .right-menu-selection a::after,
    #screen-gallery.active .right-menu-gallery a::after {
        display: block;
    }

    #screen-selection.active .right-menu-selection .button-text br,
    #screen-gallery.active .right-menu-gallery .button-text br {
        display: none;
    }
}

/*
 * Screen 2 は 100vh でスクロールしないので、高さが足りないとボタンの列のぶん中身が下で切れる
 * （横向きのスマホ 812x375 で検索フォームが画面の外へ出た）。中身が入らない高さでは Screen 2 だけ列を出さない
 * （宣伝ボタンはスクロールできる Screen 3 には出る）。しきい値は「列の下端＋中身の高さ」の実測（2026-10-09）:
 * 769〜1100px 幅で 583px・481〜768px で 532px・480px 以下で 436px。
 * 帯の下限は 768px・480px ちょうどにして重ねる（768.01px のような端数の幅で、どの帯にも当たらない隙間を作らない。
 * 重なった境界では高い方のしきい値＝隠す側になる）
 */
@media (min-width: 768px) and (max-width: 1100px) and (max-height: 590px),
       (min-width: 480px) and (max-width: 768px) and (max-height: 540px),
       (max-width: 480px) and (max-height: 440px) {
    #screen-selection.active .right-menu-selection {
        display: none !important;
    }
}

/* Screen 3: 2カラムレイアウト（左：カテゴリー+検索、右：画像/音声ボタン） */
.filters-row {
    display: flex;
    gap: 5px;
    align-items: flex-start;
    max-width: 1000px;
    margin: 0 0 20px;
    padding: 0;
}

.left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 600px; /* 4つのカテゴリーボタンが収まるよう拡張 */
}

.right-column {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 画像/音声切り替えボタン（Screen 3、2 screenと同じ.selection-buttonを使用） */
.gallery-type-buttons {
    display: flex;
    justify-content: center;
}

/* 検索フォーム（Screen 3、左カラム内で全幅表示） */
.search-form-wrapper-gallery {
    max-width: 450px; /* 検索フォームをコンパクトに */
    width: 100%;
    margin: 0;
}

.search-input-gallery {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 18px;
    outline: none;
    padding: 21px 0px;
}

/* ====================================== */
/* Screen 2↔3 コンテンツのみフェード遷移 */
/* ====================================== */

/* コンテンツフェードのトランジション設定 */
.selection-content,
.gallery-content {
    transition: opacity 0.5s ease;
}

/* コンテンツフェードアウト状態 */
.selection-content.content-fade-out,
.gallery-content.content-fade-out {
    opacity: 0;
    pointer-events: none;
}

/* 🆕 背景フェードアウト状態（Screen 2↔3 遷移用） */
.selection-bg.bg-fade-out,
.gallery-bg.bg-fade-out {
    opacity: 0 !important;
}

/* ====================================== */
/* Screen 4: SEOコンテンツ */
/* ====================================== */

.seo-section {
    background: linear-gradient(180deg, #fff5f0 0%, white 50%, #f0f8ff 100%);
    padding: 100px 20px 60px;
}

.seo-content {
    max-width: 900px;
    margin: 0 auto;
}

.seo-section-block {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.seo-heading {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 3px solid #ff9a56;
    /* ⚠️ display:flexはrubyの文字間に空白が入るため使用禁止 */
}

.heading-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
}

.seo-steps {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.seo-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(255,107,107,0.3);
}

.step-content h3 {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.step-content p {
    font-size: 16px;
    color: #666;
    line-height: 1.7;
}

.seo-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.seo-feature-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s;
}

.seo-feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.feature-emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.feature-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.feature-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* SEO特徴リスト（カード形式） */
.seo-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.seo-feature-list li {
    background: linear-gradient(135deg, rgba(255, 179, 128, 0.08) 0%, rgba(255, 153, 153, 0.08) 100%);
    border: 2px solid #ffddcc;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.seo-feature-list li:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 154, 86, 0.15);
    border-color: #ffb380;
}

.feature-icon-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-list-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

/* コスチュームアニメーション（勇者スプライト切り替え） */
.costume-anim {
    position: relative;
}

.costume-frame {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    animation: costumeSwitch 2.4s steps(1) infinite;
}

/* 4フレーム用（勇者） */
.costume-frame-1 { animation: costumeSwitch4 2.4s steps(1) infinite; animation-delay: 0s; }
.costume-frame-2 { animation: costumeSwitch4 2.4s steps(1) infinite; animation-delay: 0.6s; }
.costume-frame-3 { animation: costumeSwitch4 2.4s steps(1) infinite; animation-delay: 1.2s; }
.costume-frame-4 { animation: costumeSwitch4 2.4s steps(1) infinite; animation-delay: 1.8s; }

@keyframes costumeSwitch4 {
    0% { opacity: 1; }
    25% { opacity: 0; }
    100% { opacity: 0; }
}

/* 3フレーム用（壺） */
.jar-frame-1 { animation: costumeSwitch3 2.4s steps(1) infinite; animation-delay: 0s; }
.jar-frame-2 { animation: costumeSwitch3 2.4s steps(1) infinite; animation-delay: 0.8s; }
.jar-frame-3 { animation: costumeSwitch3 2.4s steps(1) infinite; animation-delay: 1.6s; }

@keyframes costumeSwitch3 {
    0% { opacity: 1; }
    33.33% { opacity: 0; }
    100% { opacity: 0; }
}

.feature-text {
    flex: 1;
    min-width: 0;
}

.seo-feature-list li strong {
    display: block;
    font-size: 16px;
    color: #ff9a56;
    margin-bottom: 8px;
    line-height: 1.4;
}

.seo-feature-list li .feature-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.75;
}

.seo-feature-list li .feature-desc strong {
    display: inline;
    font-size: inherit;
    color: #ff7a3d;
    margin-bottom: 0;
}

.seo-faq {
    margin-top: 20px;
}

.faq-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.faq-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.faq-question {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 10px;
    /* display: flex と gap を削除 - rubyがflex itemとして分離しスペースが入る問題を解消 */
}

.faq-answer {
    font-size: 15px;
    color: #666;
    line-height: 1.7;
    padding-left: 30px;
}

.seo-cta-section {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    margin-bottom: 40px;
}

.cta-heading {
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
}

.cta-subtext {
    font-size: 18px;
    color: rgba(255,255,255,0.95);
    margin-bottom: 30px;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background: #f8f9fa;
}

.cta-button-secondary {
    background: transparent;
    color: white;
    border: 3px solid white;
}

.cta-button-secondary:hover {
    background: white;
    color: #667eea;
}

/* ====================================== */
/* フェードアニメーション */
/* ====================================== */

.fade-out {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.5s ease !important;
}

.fade-in {
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: opacity 0.5s ease !important;
}

/* ====================================== */
/* レスポンシブ対応（Screen 1-4） */
/* ====================================== */

@media (max-width: 768px) {
    /* Screen 1 */
    .entrance-title {
        font-size: 48px;
        letter-spacing: 4px;
    }

    .entrance-button img {
        width: 200px;
    }

    /* Screen 2 */
    .selection-title {
        font-size: 36px;
    }

    .welcome-image {
        max-width: 300px;
    }

    .selection-button img {
        width: 120px;
    }

    .selection-buttons {
        gap: 30px;
    }

    .search-form-wrapper {
        padding: 20px 25px;
    }

    /* Screen 4 */
    .seo-section-block {
        padding: 30px 20px;
    }

    .seo-heading {
        font-size: 26px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .step-content h3 {
        font-size: 18px;
    }

    .step-content p {
        font-size: 14px;
    }

    .seo-features {
        grid-template-columns: 1fr;
    }

    .cta-heading {
        font-size: 26px;
    }

    .cta-subtext {
        font-size: 16px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    /* Screen 1 */
    .entrance-title {
        font-size: 36px;
        letter-spacing: 2px;
    }

    .entrance-content {
        gap: 0;
        padding-top: 60px;
    }

    .entrance-button img {
        width: 160px;
    }

    /* Screen 2 */
    .selection-title {
        font-size: 28px;
    }

    .welcome-image {
        max-width: 250px;
    }

    .selection-button img {
        width: 100px;
    }

    .search-form-wrapper {
        padding: 15px 20px;
        max-width: 100%;
    }

    .search-form-title {
        font-size: 16px;
    }

    .search-form-input {
        font-size: 14px;
        padding: 10px 14px;
    }

    /* Screen 4 */
    .seo-section {
        padding: 80px 15px 40px;
    }

    .seo-section-block {
        padding: 25px 15px;
        margin-bottom: 30px;
    }

    .seo-heading {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .seo-step {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        text-align: center;
    }

    .step-number {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .step-content h3 {
        font-size: 17px;
    }

    .step-content p {
        font-size: 13px;
    }

    .seo-feature-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .seo-feature-list li {
        padding: 16px;
    }

    .seo-feature-list li strong {
        font-size: 15px;
    }

    .feature-icon-wrap {
        width: 36px;
        height: 36px;
    }

    .feature-list-img {
        width: 36px;
        height: 36px;
    }

    .heading-icon {
        width: 32px;
        height: 32px;
    }

    .faq-question {
        font-size: 16px;
    }

    .faq-answer {
        font-size: 14px;
        padding-left: 0;
    }

    .seo-cta-section {
        padding: 35px 15px;
    }

    .cta-heading {
        font-size: 22px;
    }

    .cta-subtext {
        font-size: 14px;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 16px;
    }
}

/* フィルター */
.filters-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem 1rem 1rem;
    border-radius: 15px;
    margin-top: 1rem;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 0.7rem 1.3rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    border-color: #ff6b6b;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: white;
    border-color: #ff6b6b;
}

.tab-icon {
    font-size: 1.3rem;
}

.search-box {
    display: flex;
    align-items: center;
    position: relative;
    min-width: 150px;
    max-width: 450px;
}

.search-icon {
    position: absolute;
    left: 0.7rem;
    width: 16px;
    height: 16px;
    color: #999;
    pointer-events: none;
}

.search-input {
    flex: 1;
    padding: 0.5rem 2rem 0.5rem 2.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 0.6rem;
    background: #999;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.clear-search-btn:hover {
    background: #666;
    transform: scale(1.1);
}

/* 素材カウント行 */
.materials-count-row {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem 0.3rem 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.materials-count-text {
    color: #666;
    font-size: 1.5rem;
    -webkit-text-fill-color: #f9d25d;
    font-weight: bold;
    font-family: 'M PLUS Rounded 1c';
    text-shadow: 1px 1px 1px #000000, -1px 1px 1px #000000, 1px -1px 1px #000000, -1px -1px 1px #000000, 1px 0px 1px #000000, 0px 1px 1px #000000, -1px 0px 1px #000000, 0px -1px 1px #000000;
}

/* コインフィルターピル */
.coin-filter-pills {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.coin-filter-pill {
    display: inline-flex;
    align-items: center;
    background: rgb(255 255 255 / 26%);
    border: 3px solid rgba(249, 210, 93, 1);
    border-radius: 20px;
    color: #f9d25d;
    text-shadow: 1px 1px 1px #000000, -1px 1px 1px #000000, 1px -1px 1px #000000, -1px -1px 1px #000000, 1px 0px 1px #000000, 0px 1px 1px #000000, -1px 0px 1px #000000, 0px -1px 1px #000000;
    padding: 0.3rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.coin-filter-pill ruby {
    position: relative;
}

.coin-filter-pill rt {
    position: absolute;
    top: -0.85em;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.55em;
    line-height: 1;
}

.filter-pill-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 4px;
}

.filter-pill-emoji {
    text-shadow: none;
    margin-right: 2px;
}

.coin-filter-pill:hover {
    background: rgba(249, 210, 93, 0.2);
    transform: scale(1.05);
}

.coin-filter-pill.active {
    background: linear-gradient(135deg, #e8a820 0%, #c88a10 100%);
    color: #fff;
    border-color: #f9d25d;
    box-shadow: 0 2px 8px rgba(249, 210, 93, 0.4);
    text-shadow: 1px 1px 2px rgba(80, 50, 0, 0.6), -1px -1px 1px rgba(80, 50, 0, 0.3);
}

/* フィルタークリアボタン */
.clear-filter-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    font-weight: bold;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.clear-filter-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e04040 100%);
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* カテゴリーピルコンテナ（Screen 3、左カラム内で全幅表示） */
.category-pills-container {
    width: 100%;
    margin: 0;
    padding: 0rem 1rem 1rem 1rem;
}

/* カテゴリーピル */
.category-pills {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: nowrap; /* 大画面では1行 */
}

.category-pill {
    background-image: url("../../image/buttonFlame.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    border: none;
    color: #000;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-pill:hover {
    transform: translateY(-3px) scale(1.05);
    filter: brightness(1.1);
}

.category-pill.active {
    transform: scale(1.1);
    filter: brightness(1.2) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* タグフィルター */
.tag-filters {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 1rem 1rem;
}

.tag-filter-label {
    font-weight: 600;
    color: #f9d25d;
    -webkit-text-fill-color: #f9d25d;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    display: block;
    text-shadow: 1px 1px 1px #000000, -1px 1px 1px #000000, 1px -1px 1px #000000, -1px -1px 1px #000000, 1px 0px 1px #000000, 0px 1px 1px #000000, -1px 0px 1px #000000, 0px -1px 1px #000000;
}

.tag-checkboxes {
    display: inline-flex;
    gap: 1rem;
    flex-wrap: wrap;
}


.tag-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.6rem 1rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    user-select: none;
}

.tag-checkbox-label:hover {
    border-color: #4ecdc4;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.tag-checkbox-label input[type="checkbox"] {
    display: none;
}

.tag-checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
}

.tag-checkbox-label:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #5eb3ff 0%, #4a90e2 100%);
    color: white;
    border-color: #4a90e2;
}

/* 素材グリッド */
.materials-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.8rem;
    min-height: 400px;
}

.material-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.material-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.material-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* スプライト（キャラクター）とアイテムの画像は小さく表示 */
.material-card[data-category="sprites"] .thumbnail-img,
.material-card[data-category="items"] .thumbnail-img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

/* サムネイル音声プレーヤー */
.sound-thumbnail-player {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.thumbnail-audio-icon {
    font-size: 3rem;
    text-align: center;
    color: #ff6b6b;
    margin-top: 0.5rem;
}

.thumbnail-player-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: center;
    margin: 0.5rem 0;
}

.thumbnail-play-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a8a0 100%);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
    flex-shrink: 0;
}

.thumbnail-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.5);
}

.thumbnail-play-btn:active {
    transform: scale(0.95);
}

.thumbnail-play-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 再生アイコン（三角形） */
.thumbnail-play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent white;
    margin-left: 2px;
}

/* 一時停止アイコン（四角形） */
.thumbnail-play-icon.pause::before {
    border: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 1px;
    margin-left: 0;
}

/* 読込中アイコン（回転する円） */
.thumbnail-play-icon.loading::before {
    border: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin-left: 0;
    animation: spin 0.8s linear infinite;
}

.thumbnail-time-display {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.thumbnail-progress-bar-container {
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.thumbnail-progress-bar-container:hover {
    height: 8px;
}

.thumbnail-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a8a0 100%);
    border-radius: 5px;
    width: 0%;
    transition: width 0.1s linear;
}

/* 旧スタイル（削除予定） */
.sound-thumbnail {
    font-size: 4rem;
    color: #ff6b6b;
}

.premium-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

/* 🔒 準備中バッジ（コインシステム無効時） */
.premium-badge.coming-soon-badge {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    font-size: 0.75rem;
}

/* 🔒 プレミアム素材ロック状態（準備中） */
.material-card.premium-locked {
    cursor: not-allowed;
    position: relative;
}

/* 🔒 Coming Soon オーバーレイ（カード全体の中央に表示） */
.material-card.premium-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("../../image/commingSoon.png") no-repeat center center;
    background-size: 80%;
    z-index: 20;
    pointer-events: none;
}

.costume-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 2;
}

/* 🎬 モーションセットバッジ */
.motion-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 2;
}

/* ====================================== */
/* 🏆 購入済みバッジ・カード（コレクション機能） */
/* ====================================== */

/* 購入済みバッジ（左上配置） */
.owned-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
    z-index: 4;
    animation: ownedPulse 2s ease-in-out infinite;
}

@keyframes ownedPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(39, 174, 96, 0.6);
    }
}

/* 購入済みカードのスタイル（リボンのみで区別） */

/* 再ダウンロードボタン（購入済みプレミアム） */
.owned-download-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
    color: white !important;
}

.owned-download-btn:hover {
    background: linear-gradient(135deg, #219653 0%, #27ae60 100%) !important;
}

/* ====================================== */
/* 🎀 交換済みリボン（左上配置）           */
/* ====================================== */

.owned-ribbon {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 80px;
    height: 80px;
    z-index: 5;
    pointer-events: none;
}

/* ====================================== */
/* 🎀 所有済みダウンロードエリア（詳細ページ用） */
/* ====================================== */

.owned-download-area {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    padding: 25px;
    border-radius: 8px;
    color: white;
    text-align: center;
}

.owned-badge-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
}

.owned-ribbon-detail {
    width: 40px;
    height: 40px;
}

.download-btn-owned {
    display: block;
    width: 100%;
    background: white;
    color: #27ae60;
    padding: 15px 30px;
    border-radius: 30px;
    border: none;
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-btn-owned:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

/* ====================================== */
/* 🪙 コイン交換カード（未購入プレミアム） */
/* ====================================== */

.material-card.premium-coin {
    border: 2px solid #f0a030;
    box-shadow: 0 4px 15px rgba(240, 160, 48, 0.2);
}

.material-card.premium-coin:hover {
    border-color: #e68a00;
    box-shadow: 0 6px 20px rgba(240, 160, 48, 0.35);
}

.premium-coin-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.coin-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coin-icon-large {
    width: 40px;
    height: 40px;
}

.coin-price-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: #e68a00;
    line-height: 1;
}

.shop-key-img {
    width: 60px;
    display: block;
}

/* 🔒 封印素材カード */
.material-card.sealed-material {
    position: relative;
}

/* モンスター未取得の封印素材: 画像を真っ黒にする */
.material-card.sealed-dark .thumbnail-img {
    filter: brightness(0);
}
.material-card.sealed-dark .sound-thumbnail-player {
    filter: brightness(0);
}

/* 封印オーバーレイ（カード全体をグレーで覆う） */
.sealed-overlay {
    position: absolute;
    inset: 0;
    background: rgba(80, 80, 80, 0.55);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: inherit;
    pointer-events: none;
}

.seal-lasbo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    z-index: 2;
}

.seal-chain-img {
    position: absolute;
    top: -23px;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.7;
}

.seal-condition-text {
    font-size: 0.85rem;
    color: #fff;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    padding: 8px 14px;
    border-radius: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    z-index: 3;
}

/* コース別テキスト背景色 */
.sealed-overlay[data-seal-course="entry"] .seal-condition-text {
    background: rgba(70, 170, 220, 0.85);
}
.sealed-overlay[data-seal-course="bronze"] .seal-condition-text {
    background: rgba(180, 120, 60, 0.85);
}
.sealed-overlay[data-seal-course="silver"] .seal-condition-text {
    background: rgba(120, 125, 135, 0.9);
}
.sealed-overlay[data-seal-course="gold"] .seal-condition-text {
    background: rgba(210, 170, 50, 0.85);
}
.sealed-overlay[data-seal-course="monster"] .seal-condition-text {
    background: rgba(130, 80, 180, 0.85);
}

/* 封印通知（プレビューモーダル内） */
.seal-notice {
    background: linear-gradient(135deg, #f8f0ff 0%, #ede0f0 100%);
    border: 1px solid #c89fd4;
    border-radius: 8px;
    padding: 12px 16px;
    color: #5a1a6e;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 8px;
}

.sealed-modal-lasbo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin: 8px auto;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

/* 🔒 封印素材モーダル */
.sealed-modal-content {
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 24px !important;
}

.sealed-modal-lock {
    display: none !important;
}

.sealed-modal-condition {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
    color: #fff;
    margin: 4px 0 10px;
}

.sealed-course-entry { background: rgba(70, 170, 220, 0.9); }
.sealed-course-bronze { background: rgba(180, 120, 60, 0.9); }
.sealed-course-silver { background: rgba(120, 125, 135, 0.95); }
.sealed-course-gold { background: rgba(210, 170, 50, 0.9); }
.sealed-course-monster { background: rgba(130, 80, 180, 0.9); }

.sealed-modal-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 12px;
}

.sealed-modal-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: 30px;
    transition: all 0.2s;
}

.sealed-modal-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.sealed-modal-link img {
    width: 28px;
    height: 28px;
}

/* ============================================================
   🔒 封印素材: SEOページ用スタイル
   ============================================================ */

/* カテゴリ一覧カード: 封印オーバーレイ */
.seo-sealed-overlay {
    position: absolute;
    inset: 0;
    background: rgba(80, 80, 80, 0.55);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: inherit;
    pointer-events: none;
}

.seo-sealed-overlay .seal-lasbo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    z-index: 2;
}

.seo-sealed-overlay .seal-chain-img {
    position: absolute;
    top: -23px;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.7;
}

.seo-sealed-overlay .seal-condition-text {
    font-size: 0.85rem;
    color: #fff;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    padding: 8px 14px;
    border-radius: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    z-index: 3;
}

/* コース別テキスト背景色（SEOカード用） */
.seo-sealed-overlay[data-seal-course="entry"] .seal-condition-text {
    background: rgba(70, 170, 220, 0.85);
}
.seo-sealed-overlay[data-seal-course="bronze"] .seal-condition-text {
    background: rgba(180, 120, 60, 0.85);
}
.seo-sealed-overlay[data-seal-course="silver"] .seal-condition-text {
    background: rgba(120, 125, 135, 0.9);
}
.seo-sealed-overlay[data-seal-course="gold"] .seal-condition-text {
    background: rgba(210, 170, 50, 0.85);
}
.seo-sealed-overlay[data-seal-course="monster"] .seal-condition-text {
    background: rgba(130, 80, 180, 0.85);
}

/* 素材詳細ページ: 封印通知 */
.sealed-detail-notice {
    background: linear-gradient(135deg, #f8f0ff 0%, #ede0f0 100%);
    border: 2px solid #c89fd4;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.sealed-detail-lasbo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 12px;
}

.sealed-detail-title {
    font-size: 1.15em;
    font-weight: 700;
    color: #5a1a6e;
    margin: 0 0 10px;
}

.sealed-detail-condition {
    display: inline-block;
    font-size: 1.1em;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 20px;
    color: #fff;
    margin: 0 0 12px;
}

.sealed-detail-desc {
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
    margin: 0 0 8px;
}

.sealed-detail-desc a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.sealed-detail-coin-info {
    font-size: 0.85em;
    color: #888;
    margin: 0 0 14px;
}

.sealed-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: 30px;
    transition: all 0.2s;
}

.sealed-detail-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.sealed-link-kyun {
    width: 28px;
    height: 28px;
}

/* 🎬 モーションボタンコンテナ（モーダル内、素材名の上） */
.motion-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* 🎬 モーションボタン */
.motion-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    color: #495057;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.motion-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.motion-btn.active {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-color: #c0392b;
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* コスチュームセットカードのホバー時のアニメーション効果 */
.material-card.costume-set .material-thumbnail {
    position: relative;
    overflow: hidden;
}

/* モーションセットカードのホバー時のアニメーション効果 */
.material-card.motion-set .material-thumbnail {
    position: relative;
    overflow: hidden;
}

/* コスチュームセットのpulseアニメーション削除（コスチュームはホバー時に自動切替されるため） */

.material-info {
    padding: 1rem;
}

.material-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.material-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.8rem;
}

/* タグ表示（SPAページでも表示） */
.material-card .material-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
}

.material-card .material-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.material-card .material-tag:hover {
    background: #bbdefb;
    border-color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
}

.material-card .material-tag:active {
    transform: translateY(0);
    box-shadow: none;
}

.material-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid #f0f0f0;
}

.material-type {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #999;
    font-size: 0.85rem;
}

.download-count {
    color: #999;
    font-size: 0.85rem;
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.preview-container {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-media {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    display: block;
}

/* コスチュームナビゲーター */
.costume-navigator {
    position: absolute;
    left: 1rem;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

    /* スクロールバーのスタイル */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 107, 107, 0.5) transparent;
}

.costume-navigator::-webkit-scrollbar {
    width: 6px;
}

.costume-navigator::-webkit-scrollbar-track {
    background: transparent;
}

.costume-navigator::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.5);
    border-radius: 3px;
}

.costume-navigator::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 107, 0.7);
}

.costume-info {
    display: none; /* ファイル名表示を非表示 */
}

.costume-current {
    display: none;
}

.costume-name {
    display: none;
}

.costume-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.costume-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.costume-thumbnail:hover {
    border-color: #ff6b6b;
    transform: scale(1.05);
}

.costume-thumbnail.active {
    border-color: #4ecdc4;
    box-shadow: 0 3px 10px rgba(78, 205, 196, 0.3);
}

.costume-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.costume-number {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.audio-preview {
    padding: 2rem;
}

.audio-icon-large {
    font-size: 5rem;
    margin-bottom: 1rem;
}

/* カスタム音声プレイヤー */
.custom-audio-player {
    width: 100%;
    max-width: 500px;
    margin: 1.5rem auto 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.player-top-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.play-pause-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a8a0 100%);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(78, 205, 196, 0.3);
}

.play-pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.5);
}

.play-pause-btn:active {
    transform: scale(0.95);
}

.play-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 再生アイコン（三角形） */
.play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent white;
    margin-left: 3px;
}

/* 一時停止アイコン（四角形） */
.play-icon.pause::before {
    border: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 2px;
    margin-left: 0;
}

/* 読込中アイコン（回転する円） */
.play-icon.loading::before {
    border: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin-left: 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.time-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #666;
    font-weight: 600;
}

.time-separator {
    color: #999;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-bar-container:hover {
    height: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a8a0 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s linear;
}

.player-bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.volume-icon {
    font-size: 1.2rem;
}

.volume-slider {
    flex: 1;
    max-width: 120px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4ecdc4;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #44a8a0;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4ecdc4;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: #44a8a0;
}

.loop-toggle-btn {
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    color: #666;
}

.loop-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.loop-toggle-btn.active {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a8a0 100%);
    border-color: #4ecdc4;
    color: white;
}

.loop-icon {
    font-size: 1.1rem;
}

.loop-text {
    font-weight: 600;
}

/* コインの BGM を交換する前の試聴版（最初の◯秒だけ）の案内。ループのボタンはこのとき隠す（listen-audio.js） */
.audio-trial-note {
    margin: 0.8rem 0 0;
    padding: 0.5rem 0.9rem;
    border-radius: 12px;
    background: #fff8e1;
    color: #7a5b00;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.9;
}

.audio-trial-note[hidden],
.loop-toggle-btn[hidden] {
    display: none;
}

.material-info {
    padding: 2rem;
}

.material-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.material-meta {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
}

.material-meta-item {
    display: flex;
    gap: 0.5rem;
}

.meta-label {
    font-weight: 600;
    color: #666;
}

.meta-value {
    color: #333;
}

.material-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.tag {
    background: #f0f0f0;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    color: #666;
}

.download-section {
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
}

.download-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a8a0 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 auto;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.4);
}

.download-icon {
    font-size: 1.4rem;
}

.credits-info {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fff5e0;
    border-radius: 10px;
    border-left: 4px solid #ff9a56;
}

.credits-text {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.premium-notice {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff5e0 0%, #ffe0b3 100%);
    border-radius: 15px;
    margin: 1rem 0;
}

.premium-badge-large {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.upgrade-link {
    color: #ff6b6b;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    border: 2px solid #ff6b6b;
    border-radius: 20px;
    transition: all 0.3s;
}

/* スクラッチコイン交換の説明文 */
.coin-exchange-notice {
    text-align: center;
    padding: 0.8rem 1rem;
    margin-top: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.coin-notice-text {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.scratch-monster-link {
    color: #ff6b6b;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.scratch-monster-link:hover {
    color: #ff5252;
    text-decoration: underline;
}

.upgrade-link:hover {
    background: #ff6b6b;
    color: white;
}

/* フッター */
.sozai-footer {
    background: #333;
    color: white;
    padding: 2rem 1rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* カテゴリリンク */
.footer-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-categories a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.footer-categories a:hover {
    color: white;
}

/* 法的リンク */
.footer-legal {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #555;
}

.footer-legal a {
    color: #8cc4ff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-legal a:hover {
    color: white;
}

.footer-divider {
    color: #666;
}

/* 関連サービス */
.footer-services {
    margin-bottom: 1rem;
}
.footer-services a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}
.footer-services a:hover {
    color: white;
}
.footer-service-icon-img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
}

/* サイト情報 */
.footer-info {
    text-align: center;
}

.footer-logo {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.footer-logo img {
    height: 60px;
    width: auto;
    filter: brightness(1.1);
    transition: opacity 0.3s ease;
}

.footer-logo:hover img {
    opacity: 0.8;
}

.footer-description {
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.footer-copyright {
    color: #888;
    font-size: 0.8rem;
}

.footer-scratch-credit {
    color: #888;
    font-size: 0.72rem;
    line-height: 1.6;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.footer-scratch-credit a {
    color: #aaa;
    text-decoration: underline;
}

.footer-scratch-credit a:hover {
    color: #ddd;
}

/* トーストメッセージ */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    font-weight: 500;
}

/* ローディング */
.loading-container {
    text-align: center;
    padding: 4rem;
}

.loading-spinner {
    display: inline-block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* エラー */
.error-container {
    text-align: center;
    padding: 4rem;
}

.error-message {
    display: inline-block;
    background: #fff5f5;
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid #ffdddd;
}

.error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.retry-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .guide-steps {
        flex-wrap: wrap;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-row {
        flex-direction: column;
    }
    
    .materials-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .modal-content {
        width: 95%;
    }
}

/* ロードモアボタン */
.load-more-container {
    text-align: center;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* 下部カテゴリーピルコンテナ（もっと見るボタンの下） */
.bottom-category-pills-container {
    text-align: center;
    padding: 0.5rem 1rem 2rem 1rem;
}

.bottom-category-pills-container .category-pills {
    justify-content: center;
}

/* =========================================
   ログイン機能（sokunと共有）
   ========================================= */

.header-right {
    display: flex;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.btn-ai-sokun {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn-ai-sokun:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-header-login {
    display: none; /* デフォルト非表示（FOUC防止、ログインシステム再有効化時にJSで表示） */
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.btn-header-login:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* ============================================================
   🔐 画面右固定ログインエリア
   ============================================================ */
.fixed-login-area {
    position: fixed !important;
    top: 20px !important;
    right: 37px !important;
    z-index: 1000 !important;
}

/* ログインボタン（固定配置用） */
.fixed-login {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 40px;
    padding: 0 20px;
    background: rgb(120 199 255 / 90%) !important;
    border: none !important;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #FFFFFF !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fixed-login:hover {
    background: rgb(90 180 245 / 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

/* ログイン後のユーザー情報エリア */
#userInfoArea.logged-in {
    background: rgb(255 229 47) !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

#userInfoArea .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 0;
}

#userInfoArea .user-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

#userInfoArea .membership-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

#userInfoArea .membership-badge.hero {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #5a4a00;
}

#userInfoArea .membership-badge.org {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#userInfoArea .btn-logout {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#userInfoArea .btn-logout:hover {
    background: #ff5252;
}

/* スクラッチコイン表示 */
.coin-display {
    display: flex;
    align-items: center;
    color: #333;
    padding: 0.5rem 0rem;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
    cursor: help;
}

.coin-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.coin-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    animation: coinSpin 3s ease-in-out infinite;
}

.coin-icon-small {
    width: 26px;
    height: 26px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes coinSpin {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg);
    }
}

.coin-amount {
    font-size: 1.1rem;
    min-width: 40px;
    text-align: center;
    font-weight: 900;
    color: #fed54d;
    text-shadow: 1px 1px 1px #000, -1px 1px 1px #000, 1px -1px 1px #000, -1px -1px 1px #000, 1px 0 1px #000, 0 1px 1px #000, -1px 0 1px #000, 0 -1px 1px #000;
    font-family: Arial Black, Arial, sans-serif;
}

/* スクラッチコインツールチップ */
.coin-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    pointer-events: auto; /* リンククリック可能にする */
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
}

.coin-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #ff9a56;
}

.coin-display:hover .coin-tooltip,
.coin-tooltip:hover {
    opacity: 1;
    visibility: visible;
}

.coin-tooltip a {
    color: #fff;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
    transition: all 0.3s;
    display: inline-block;
}

.coin-tooltip a:hover {
    color: #ffed4e;
    text-shadow: 0 0 8px rgba(255, 237, 78, 0.6);
    transform: scale(1.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.user-info.active {
    animation: fadeIn 0.3s ease-in;
}

.user-name {
    font-weight: 600;
    color: #ff6b6b;
}

.membership-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.membership-badge.hero {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: white;
}

.membership-badge.org {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-logout {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #ff5252;
}

/* ログインモーダル */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.login-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

.login-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header h2 {
    color: #ff6b6b;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.login-form {
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label .label-hint {
    font-weight: normal;
    font-size: 0.78rem;
    color: #888;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 0.8rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s;
}

.login-actions {
    display: flex;
    gap: 1rem;
}

.btn-login {
    flex: 1;
    background: linear-gradient(135deg, #ff9a56, #ff6b6b);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-cancel {
    flex: 1;
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 0.8rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: #d0d0d0;
}

.login-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.login-footer p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.register-link {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.register-link:hover {
    text-decoration: underline;
}

.register-note {
    color: #888;
    font-size: 0.85rem;
    margin-top: 4px;
}

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

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* プレミアム素材のロック表示 */
.material-card.premium.locked {
    position: relative;
    opacity: 0.7;
}

.material-card.premium.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* トースト通知の成功スタイル */
.toast.success {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

/* クールダウンインジケーターアニメーション */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .btn-ai-sokun {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .login-content {
        padding: 1.5rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }
}

/* ==========================================
   グローバルメニュー
   ========================================== */

/* メニュートグルボタン（sokunと同じスタイル） */
.btn-menu-toggle {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-menu-toggle span {
    width: 30px;
    height: 3px;
    background: #FFFFFF;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.btn-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* グローバルメニュー（左サイドから開く） */
.global-menu {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.global-menu.active {
    left: 0;
}

.menu-header {
    padding: 1.5rem;
    background: #4285f4;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h3 {
    font-size: 1.2rem;
    margin: 0;
}

.menu-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.menu-item {
    border-bottom: 1px solid #f0f0f0;
}

.menu-item a,
.menu-button {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
    width: 100%;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.menu-item a:hover,
.menu-button:hover {
    background: #f8f9fa;
}

.menu-icon {
    margin-right: 1rem;
    font-size: 1.2rem;
    font-style: normal;
    width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.external-link {
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.6;
    font-style: normal;
}

/* 危険なアイテム */
.menu-item-danger .menu-button {
    color: #dc3545;
}

.menu-item-danger .menu-button:hover {
    background: #fff5f5;
}

/* ルビ設定トグル - スクラッチモンスターと統一デザイン */
.menu-item-toggle {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: transparent;
}

.menu-item-toggle .toggle-label-text {
    display: flex;
    align-items: center;
    flex: 1;
    color: #333;
    font-size: 1rem;
}

.menu-item-toggle .menu-icon {
    margin-right: 1rem;
    font-size: 1.2rem;
    font-style: normal;
    width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.menu-toggle-switch input {
    display: none;
}

.menu-toggle-switch .toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ddd;
    border-radius: 28px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.menu-toggle-switch .toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.menu-toggle-switch input:checked + .toggle-slider {
    background: #ff9a56;
}

.menu-toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.ruby-status-text {
    margin-left: 12px;
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

/* オーバーレイ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    cursor: pointer;
}

.menu-overlay.active {
    display: block;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .btn-menu-toggle {
        width: 36px;
        height: 36px;
    }

    .btn-menu-toggle span {
        width: 20px;
    }

    .global-menu {
        width: 280px;
        left: -280px;
    }

    .menu-header {
        padding: 1.2rem;
    }

    .menu-item a,
    .menu-button {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }

    .menu-icon {
        font-size: 1.1rem;
        width: 28px;
    }
}

@media (max-width: 480px) {
    .global-menu {
        width: 100%;
        left: -100%;
    }

    .menu-header h3 {
        font-size: 1.1rem;
    }

    .menu-item a,
    .menu-button {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }

    .menu-icon {
        font-size: 1rem;
        width: 26px;
    }
}

/* ==========================================
   Screen 2の背景設定
   ========================================== */
/* .selection-bg は position: fixed で画面全体をカバー（上部で設定済み） */
/* フッターは通常表示（スクロールで表示される） */

/* ==========================================
   追加レスポンシブ対応（2025-11-27）
   ========================================== */

/* タブレット（768px以下） */
@media (max-width: 768px) {
    /* Screen 1: タイトル系 */
    .main-title {
        font-size: 52px !important;
    }

    .sub-title {
        font-size: 28px !important;
        letter-spacing: 2px !important;
    }

    .catch-copy {
        font-size: 16px !important;
        margin-bottom: 30px !important;
    }

    /* 右上ボタン（Screen 2/3）は隠さず、ヘッダーの下に横並び（.right-menu-gallery の定義のあとの節） */

    /* ヘッダーロゴ */
    .logo-image {
        height: 50px;
        margin-top: -10px;
    }

    /* 選択ボタンテキスト */
    .selection-button span {
        font-size: 28px;
    }

    /* ルビサイズ調整（スマホ対応）- 通常のインラインルビに戻す */
    .selection-button span ruby rt {
        font-size: 11px;
        position: static;
        top: auto;
        left: auto;
        transform: none;
    }

    .selection-button {
        width: 150px;
        height: 80px;
        padding: 30px 10px;
    }

    .selection-button img {
        width: 40px;
    }

    /* Screen 3: フィルターレイアウト */
    .filters-row {
        flex-direction: column;
        gap: 15px;
        max-width: 100%;
    }

    .left-column {
        max-width: 100%;
        width: 100%;
    }

    .right-column {
        width: 100%;
        justify-content: flex-start;
    }

    .gallery-type-buttons {
        justify-content: flex-start;
    }

    .gallery-content {
        padding-top: 70px;
    }

    /* カテゴリーピル */
    .category-pills {
        flex-wrap: wrap; /* タブレット以下では折り返し */
    }

    .category-pill {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-height: 38px;
    }

    .category-pills-container {
        padding: 0rem 0.5rem 0.8rem 0.5rem;
    }

    /* 検索フォーム */
    .search-form-wrapper-gallery {
        max-width: 100%; /* タブレットでは全幅に戻す */
    }

    .search-input-gallery {
        font-size: 16px;
        padding: 16px 0px;
    }

    /* タグフィルター */
    .tag-filters {
        padding: 1rem 0.5rem 0.8rem 0.5rem;
    }

    .tag-checkbox-label {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    /* 素材カウント */
    .materials-count-row {
        padding: 0.8rem 0.5rem 0.3rem 1rem;
    }

    .coin-filter-pill {
        font-size: 0.8rem;
        padding: 0.25rem 0.7rem;
    }

    /* 素材グリッド */
    .materials-grid {
        padding: 0.5rem;
        gap: 1rem;
    }

    /* モーダル：メタ情報 */
    .material-meta {
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* トースト */
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    /* welcome画像 */
    .welcome-image {
        max-width: 280px;
        margin-top: -15px;
    }

    /* selection-content gap調整 */
    .selection-content {
        gap: 20px;
    }
}

/* スマホ（480px以下） */
@media (max-width: 480px) {
    /* Screen 1: タイトル系 */
    .main-title {
        font-size: 38px !important;
    }

    .sub-title {
        font-size: 20px !important;
        letter-spacing: 1px !important;
    }

    .catch-copy {
        font-size: 13px !important;
        margin-bottom: 25px !important;
    }

    .entrance-button-img {
        width: 120px !important;
    }

    .enter-finger {
        width: 35px !important;
        right: 10px;
        bottom: 0px;
    }

    /* ヘッダーロゴ */
    .logo-image {
        height: 40px;
        margin-top: -8px;
    }

    /* ヘッダーアクション */
    .header-actions {
        gap: 0.4rem;
    }

    /* 選択ボタン */
    .selection-button span {
        font-size: 22px;
    }

    /* ルビサイズ調整（小画面）- 通常のインラインルビに戻す */
    .selection-button span ruby rt {
        font-size: 9px;
        position: static;
        top: auto;
        left: auto;
        transform: none;
    }

    .selection-button {
        width: 120px;
        height: 65px;
        padding: 25px 8px;
    }

    .selection-button img {
        width: 32px;
    }

    .selection-buttons {
        gap: 20px;
    }

    /* 選択タイトル */
    .selection-title {
        font-size: 24px;
        margin: 5px 0 0;
        padding: 8px 0 0;
    }

    /* ギャラリーコンテンツ */
    .gallery-content {
        padding-top: 60px;
    }

    /* カテゴリーピル */
    .category-pill {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        min-height: 34px;
    }

    .category-pills {
        gap: 0.4rem;
        flex-wrap: wrap; /* 小画面では折り返し */
    }

    /* 検索フォーム */
    .search-form-bg {
        padding: 3px 20px;
        margin: 0 10px 0 3px;
    }

    .search-input-gallery {
        font-size: 14px;
        padding: 14px 0px;
    }

    #searchSubmitButtonGallery {
        height: 30px;
    }

    #searchSubmitButtonGallery img {
        height: 30px;
    }

    /* タグフィルター */
    .tag-checkboxes {
        gap: 0.6rem;
    }

    .tag-checkbox-label {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .tag-filter-label {
        font-size: 0.85rem;
    }

    /* 素材カウント */
    .materials-count-text {
        font-size: 1.2rem;
    }

    /* 素材カード */
    .material-thumbnail {
        height: 140px;
    }

    .material-title {
        font-size: 0.95rem;
    }

    .material-description {
        font-size: 0.8rem;
    }

    /* 交換済みリボン（モバイル） */
    .owned-ribbon {
        width: 60px;
        height: 60px;
    }

    /* コイン交換カード（モバイル） */
    .coin-icon-large {
        width: 32px;
        height: 32px;
    }

    .coin-price-text {
        font-size: 1.3rem;
    }

    .shop-key-img {
        width: 48px;
    }

    /* welcome画像 */
    .welcome-image {
        max-width: 220px;
        margin-top: -10px;
    }

    /* selection-content gap調整 */
    .selection-content {
        gap: 15px;
        padding: 1rem;
    }

    /* Screen 2 検索フォーム */
    .search-form-wrapper {
        max-width: 280px;
    }

    #searchInputSelection {
        font-size: 14px;
        padding: 6px;
    }

    #searchSubmitButton {
        width: 40px;
        height: 40px;
    }

    /* モーダル */
    .modal-content {
        width: 98%;
        border-radius: 15px;
    }

    .preview-container {
        padding: 1rem;
    }

    .material-info {
        padding: 1rem;
    }

    .material-name {
        font-size: 1.3rem;
    }

    .download-section {
        padding: 1rem;
    }

    .download-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .credits-info {
        padding: 0.8rem;
    }

    .credits-text {
        font-size: 0.8rem;
    }

    /* カスタム音声プレイヤー */
    .custom-audio-player {
        padding: 0.8rem 1rem;
    }

    .play-pause-btn {
        width: 40px;
        height: 40px;
    }

    .loop-toggle-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    /* フッター */
    .footer-categories {
        gap: 0.3rem 1rem;
    }

    .footer-categories a {
        font-size: 0.85rem;
    }

    .footer-legal {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .footer-legal a {
        font-size: 0.8rem;
    }

    .footer-divider {
        display: none;
    }

    .footer-logo img {
        height: 45px;
    }

    /* メニューボタン */
    .btn-menu-toggle {
        width: 32px;
        height: 32px;
    }

    .btn-menu-toggle span {
        width: 18px;
        height: 2px;
    }

    /* コイン表示 */
    .coin-display {
        padding: 0.4rem 0rem;
    }

    .coin-icon {
        width: 22px;
        height: 22px;
    }

    .coin-amount {
        font-size: 0.95rem;
        min-width: 30px;
    }
}

/* ====================================== */
/* 🔧 モバイル実機でのルビ表示修正（最終オーバーライド） */
/* 'M PLUS Rounded 1c' フォントがモバイルでルビ間隔を広げてしまう問題の対策 */
/* このセクションはファイル末尾に配置し、全ての他のルールより優先させる */
/* ====================================== */
@media screen and (max-width: 1024px) {
    /* body全体 */
    body.fullscreen-body {
        font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif !important;
    }

    /* 個別にfont-familyが指定されている要素を全てオーバーライド */
    body.fullscreen-body .catch-copy,
    body.fullscreen-body .selection-button,
    body.fullscreen-body .selection-button span,
    body.fullscreen-body .materials-count-text,
    body.fullscreen-body .clear-filter-btn,
    body.fullscreen-body .entrance-title,
    body.fullscreen-body .gallery-title,
    body.fullscreen-body h1,
    body.fullscreen-body h2,
    body.fullscreen-body h3,
    body.fullscreen-body p,
    body.fullscreen-body span,
    body.fullscreen-body button,
    body.fullscreen-body a,
    body.fullscreen-body ruby,
    body.fullscreen-body rt {
        font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif !important;
    }

    /* タイトル部分は元のフォントを維持 */
    body.fullscreen-body .main-title {
        font-family: "Alfa Slab One" !important;
    }
    body.fullscreen-body .sub-title {
        font-family: 'Dela Gothic One' !important;
    }
}

/* ====================================== */
/* お知らせ機能 */
/* ====================================== */

/* ベルアイコンラッパー */
.notice-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
}

/* ベルアイコン */
.notice-bell {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    transition: transform 0.2s ease;
}

.notice-bell:hover {
    transform: scale(1.1);
}

.notice-bell svg {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* 未読バッジ */
.notice-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(238, 90, 90, 0.4);
    animation: badge-pulse 2s infinite;
}

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

/* お知らせドロップダウン */
.notice-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    overflow: hidden;
    animation: dropdown-appear 0.2s ease;
}

@keyframes dropdown-appear {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notice-list {
    max-height: 300px;
    overflow-y: auto;
}

.notice-item {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.notice-item:hover {
    background: #f8f9fa;
}

.notice-item:last-child {
    border-bottom: none;
}

.notice-item.unread {
    background: linear-gradient(to right, #fff8e1, white);
}

.notice-item.important {
    border-left: 3px solid #ff9800;
}

.notice-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-icon {
    font-size: 12px;
}

.notice-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-date {
    font-size: 12px;
    color: #999;
}

.no-notices {
    padding: 30px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.dropdown-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #eee;
}

.view-all-link {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #764ba2;
}

/* お知らせ詳細モーダル */
.notice-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: notice-overlay-appear 0.2s ease;
}

@keyframes notice-overlay-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

.notice-modal {
    background: white;
    border-radius: 20px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: notice-modal-appear 0.25s ease;
}

@keyframes notice-modal-appear {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.notice-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.notice-modal-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.notice-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
}

.notice-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.notice-modal-date {
    padding: 12px 20px;
    font-size: 13px;
    color: #999;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.notice-modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}

.notice-modal-content p {
    margin-bottom: 1em;
}

.notice-modal-content a {
    color: #667eea;
}

.notice-modal-content ul,
.notice-modal-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.notice-modal-footer {
    padding: 16px 20px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #eee;
}

.notice-modal-close-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 36px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.notice-modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 緊急お知らせモーダル */
.urgent-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
}

.urgent-modal {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 3px solid #f44336;
}

.urgent-modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    text-align: center;
}

.urgent-modal-header .urgent-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
    animation: urgent-bounce 1s infinite;
}

@keyframes urgent-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.urgent-modal-header h3 {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.urgent-modal-body {
    padding: 24px;
}

.urgent-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.urgent-content {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}

.urgent-modal-footer {
    padding: 20px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #eee;
}

.urgent-modal-confirm {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.urgent-modal-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

/* お知らせ一覧ページ */
.notices-page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 60px;
    min-height: 100vh;
}

.notices-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.notices-page-header h1 {
    font-size: 28px;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.notices-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.notices-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.notices-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.notices-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ページネーション */
.notices-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-btn {
    background: #4285f4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #3367d6;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-numbers {
    display: flex;
    gap: 6px;
    align-items: center;
}

.pagination-num {
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-num:hover {
    border-color: #4285f4;
    color: #4285f4;
}

.pagination-num.active {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

.pagination-ellipsis {
    color: #999;
    padding: 0 4px;
}

.notice-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid transparent;
}

.notice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.notice-card.unread {
    background: linear-gradient(to right, #fff8e1, white);
    border-left-color: #ffb300;
}

.notice-card.important {
    border-left-color: #ff9800;
}

.notice-card.urgent {
    border-left-color: #f44336;
    background: linear-gradient(to right, #ffebee, white);
}

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

.notice-badges {
    display: flex;
    gap: 8px;
}

.notice-badge-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.badge-unread {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-important {
    background: #fff3e0;
    color: #e65100;
}

.badge-urgent {
    background: #ffebee;
    color: #c62828;
}

.notice-card-date {
    font-size: 12px;
    color: #999;
}

.notice-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.notice-card-excerpt {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* レスポンシブ - お知らせ機能 */
@media (max-width: 640px) {
    .notice-dropdown {
        width: 290px;
        right: -10px;
    }

    .notice-modal {
        max-height: 90vh;
    }

    .notice-modal-header h3 {
        font-size: 16px;
    }

    .notices-page-container {
        padding: 0 15px 40px;
    }

    .notices-page-header h1 {
        font-size: 22px;
    }

    .notice-card {
        padding: 16px;
    }

    .notice-card-title {
        font-size: 15px;
    }

    .notice-bell {
        width: 36px;
        height: 36px;
    }

    .notice-bell svg {
        width: 20px;
        height: 20px;
    }
}

/* ====================================== */
/* コイン交換確認モーダル */
/* ====================================== */

.exchange-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exchange-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.exchange-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: exchangeFadeIn 0.25s ease-out;
}

@keyframes exchangeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.exchange-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.exchange-close:hover {
    color: #333;
}

.exchange-preview {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.exchange-image {
    max-width: 280px;
    max-height: 220px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.exchange-audio-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.exchange-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.5;
}

.exchange-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.exchange-coin-icon {
    width: 48px;
    height: 48px;
}

.exchange-cost {
    font-size: 2rem;
    font-weight: 800;
    color: #f59e0b;
}

.exchange-balance {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 8px;
}

.exchange-insufficient {
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.exchange-btn {
    display: inline-block;
    width: 100%;
    padding: 14px 0;
    margin-top: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #4f8cff, #3366cc);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.exchange-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.exchange-btn:active:not(:disabled) {
    transform: translateY(0);
}

.exchange-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.exchange-coin-note {
    text-align: center;
    color: #999;
    font-size: 0.85em;
    margin-top: 12px;
}

/* モバイル対応 */
@media (max-width: 480px) {
    .exchange-content {
        max-width: 90vw;
        padding: 24px 20px;
    }

    .exchange-image {
        max-width: 200px;
        max-height: 160px;
    }

    .exchange-coin-icon {
        width: 36px;
        height: 36px;
    }

    .exchange-cost {
        font-size: 1.6rem;
    }

    .exchange-name {
        font-size: 1rem;
    }

    .exchange-btn {
        font-size: 1rem;
        padding: 12px 0;
    }
}

/* ====================================== */
/* 素材の種類カード（SEOセクション内） */
/* ====================================== */

/* サービス紹介ブロック */
.service-intro {
    text-align: center;
    padding: 50px 30px 40px;
}

.intro-logo {
    max-width: 320px;
    width: 100%;
    height: auto;
    margin-bottom: 24px;
}

.intro-lead {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    line-height: 1.8;
    margin-bottom: 24px;
}

.intro-categories {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}

.intro-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #555;
}

.intro-cat-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* 素材ショーケース（アニメーション付き） */
.intro-showcase {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.intro-showcase-item {
    text-align: center;
}

.intro-anim {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.intro-anim-bg {
    width: 200px;
    height: 150px;
}

.intro-anim-sprite,
.intro-anim-item {
    width: 120px;
    height: 120px;
    background: #f5f5f5;
}

.intro-anim-audio {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.intro-audio-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.intro-audio-icon-sfx {
    filter: hue-rotate(200deg) saturate(1.5);
}

/* ショーケースのクリック可能スタイル */
a.intro-showcase-item {
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

a.intro-showcase-item:hover {
    transform: translateY(-4px);
}

a.intro-showcase-item:hover .intro-anim {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}


.intro-anim-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 背景用3フレームアニメーション */
.intro-bg-1 { animation: bgSwitch3 4.5s steps(1) infinite; animation-delay: 0s; z-index: 3; }
.intro-bg-2 { animation: bgSwitch3 4.5s steps(1) infinite; animation-delay: 1.5s; z-index: 2; }
.intro-bg-3 { animation: bgSwitch3 4.5s steps(1) infinite; animation-delay: 3s; z-index: 1; }

@keyframes bgSwitch3 {
    0% { opacity: 1; }
    33.33% { opacity: 0; }
    100% { opacity: 0; }
}

.intro-showcase-label {
    display: block;
    margin-top: 8px;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #777;
}

.intro-sub {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    line-height: 1.7;
}

.intro-sub strong {
    color: #4ecdc4;
}

@media (max-width: 768px) {
    .service-intro {
        padding: 36px 16px 28px;
    }

    .intro-logo {
        max-width: 240px;
    }

    .intro-lead {
        font-size: 16px;
    }

    .intro-showcase {
        gap: 12px;
    }

    .intro-anim-bg {
        width: 140px;
        height: 105px;
    }

    .intro-anim-sprite,
    .intro-anim-item,
    .intro-anim-audio {
        width: 90px;
        height: 90px;
    }

    .intro-audio-icon {
        width: 40px;
        height: 40px;
    }

    .intro-showcase {
        flex-wrap: wrap;
    }

    .intro-showcase-label {
        font-size: 12px;
    }
}

.features-block {
    padding: 40px 30px;
}

.features-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: #fafafa;
    border-radius: 16px;
    padding: 28px 20px 24px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 5px solid transparent;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.feature-card-free {
    border-top-color: #4ecdc4;
}

.feature-card-coin {
    border-top-color: #f9d25d;
}

.feature-card-sealed {
    border-top-color: #a78bfa;
}

.feature-icon {
    margin-bottom: 12px;
    line-height: 1;
}

.feature-card-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.feature-card-title {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #333;
    margin-bottom: 10px;
}

.feature-card-free .feature-card-title {
    color: #2aaa9e;
}

.feature-card-coin .feature-card-title {
    color: #c5960a;
}

.feature-card-sealed .feature-card-title {
    color: #7c3aed;
}

.feature-card-desc {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    line-height: 1.7;
}

.feature-link {
    color: #ff7e33;
    font-weight: 700;
    text-decoration: none;
}

.feature-link:hover {
    text-decoration: underline;
}

/* ====================================== */
/* 姉妹サイトの案内（トップのいちばん下）           */
/* 2026-10-28 作り直し＝案C「コインの道のり」。     */
/* 試作: prototypes/sister-cta-mock                 */
/* 色はコードブレイバーの語彙（空の青・紺の縁・黄色の札・水色の主ボタン） */
/* ====================================== */

.sister-cta {
    position: relative;
    margin-bottom: 40px;
    padding: 30px 30px 0;
    border-radius: 24px;
    overflow: hidden;
    text-align: center;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: linear-gradient(180deg, #8fd3ff 0%, #c7ecff 55%, #e8f8ff 100%);
    box-shadow: 0 10px 30px rgba(26, 99, 200, 0.16);
}

/* 雲 */
.sister-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(60px 26px at 12% 18%, #fff 60%, transparent 62%),
        radial-gradient(42px 22px at 17% 14%, #fff 60%, transparent 62%),
        radial-gradient(70px 28px at 86% 12%, #fff 60%, transparent 62%),
        radial-gradient(46px 22px at 80% 9%, #fff 60%, transparent 62%);
    opacity: 0.9;
}

.sister-cta > * {
    position: relative;
}

.sister-cta-tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 900;
    color: #123a7a;
    background: #ffcf1f;
    border: 2px solid #123a7a;
    border-radius: 999px;
    padding: 3px 12px 2px;
    box-shadow: 0 2px 0 #123a7a;
}

.sister-cta-logo {
    display: block;
    width: 300px;
    max-width: 70%;
    height: auto;
    margin: 0 auto 4px;
    filter: drop-shadow(0 6px 10px rgba(18, 58, 122, 0.25));
}

.sister-cta-title {
    margin: 8px 0 22px;
    font-size: 26px;
    font-weight: 900;
    line-height: 1.45;
    color: #123a7a;
}

.sister-cta-nb {
    display: inline-block;
}

/* 道のり: ① → ② → ③ */
.sister-cta-road {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 56px;
    max-width: 720px;
    margin: 0 auto 22px;
    padding: 0;
}

.sister-cta-stop {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* 矢印（次の駅とのあいだ） */
.sister-cta-stop:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px;
    right: -45px;
    width: 34px;
    height: 24px;
    background: #1a63c8;
    clip-path: polygon(0 33%, 58% 33%, 58% 0, 100% 50%, 58% 100%, 58% 67%, 0 67%);
}

.sister-cta-disc {
    position: relative;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: 0 0 0 3px #1a63c8, 0 8px 16px rgba(18, 58, 122, 0.22);
    display: grid;
    place-items: center;
}

.sister-cta-disc > img {
    grid-area: 1 / 1;
    width: 78%;
    height: 78%;
    object-fit: contain;
}

.sister-cta-disc > img.sister-cta-blocks {
    width: 74%;
    height: 74%;
}

.sister-cta-disc > img.sister-cta-lock {
    place-self: end;
    width: 34px;
    height: 34px;
    margin: 0 2px 2px 0;
}

.sister-cta-num {
    position: absolute;
    top: -10px;
    left: -10px;
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffcf1f;
    border: 3px solid #123a7a;
    color: #123a7a;
    font-size: 16px;
    font-weight: 900;
    line-height: 26px;
    text-align: center;
}

.sister-cta-label {
    font-size: 15px;
    font-weight: 900;
    line-height: 1.5;
    color: #123a7a;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 6px 10px;
}

/* 主ボタン: 水色＋紺の縁（コードブレイバーのステージ画面のボタン） */
.sister-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px 34px 15px;
    border: 3px solid #123a7a;
    border-radius: 999px;
    background: linear-gradient(180deg, #6fe6ff 0%, #22c3ef 55%, #12a8d8 100%);
    box-shadow: 0 5px 0 #123a7a, 0 10px 18px rgba(18, 58, 122, 0.25);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-shadow: 2px 0 0 #123a7a, -2px 0 0 #123a7a, 0 2px 0 #123a7a, 0 -2px 0 #123a7a, 1.5px 1.5px 0 #123a7a, -1.5px 1.5px 0 #123a7a, 1.5px -1.5px 0 #123a7a, -1.5px -1.5px 0 #123a7a;
    transition: transform 0.12s, box-shadow 0.12s;
}

.sister-cta-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #123a7a, 0 14px 22px rgba(18, 58, 122, 0.28);
}

.sister-cta-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #123a7a, 0 4px 8px rgba(18, 58, 122, 0.2);
}

.sister-cta-arw {
    width: 0;
    height: 0;
    border-left: 11px solid #fff;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    filter: drop-shadow(1.5px 0 0 #123a7a) drop-shadow(-1.5px 0 0 #123a7a) drop-shadow(0 1.5px 0 #123a7a) drop-shadow(0 -1.5px 0 #123a7a);
}

/* 下の草地: コードクラフト */
.sister-cta-grass {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 -30px;
    padding: 18px 24px;
    background: linear-gradient(180deg, #8fd35a 0%, #67b83d 100%);
    border-top: 4px solid #a9e070;
}

.sister-cta-grass p {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.6;
    color: #fff;
    text-shadow: 0 1px 2px rgba(30, 70, 10, 0.6);
}

/* コードクラフトのボタン: ロゴの黄色＋紫の縁 */
.sister-cta-craft-btn {
    display: inline-block;
    padding: 10px 22px 11px;
    border: 3px solid #4a2380;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe36e 0%, #ffc92e 100%);
    box-shadow: 0 4px 0 #4a2380;
    color: #4a2380;
    font-size: 16px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.12s, box-shadow 0.12s;
}

.sister-cta-craft-btn:hover {
    color: #4a2380;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #4a2380;
}

.sister-cta-craft-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #4a2380;
}

/* 3つの説明が細かく折れない幅（761px 以上）だけ横に並べ、それより狭いと道のりを縦に */
@media (max-width: 760px) {
    .sister-cta-road {
        flex-direction: column;
        gap: 22px;
        margin-bottom: 18px;
    }

    .sister-cta-stop {
        flex-direction: row;
        gap: 14px;
        text-align: left;
    }

    .sister-cta-stop:not(:last-child)::after {
        top: auto;
        right: auto;
        bottom: -22px;
        left: 25px;
        width: 26px;
        height: 22px;
        transform: rotate(90deg);
    }

    .sister-cta-disc {
        flex: none;
        width: 76px;
        height: 76px;
        border-width: 3px;
    }

    .sister-cta-disc > img.sister-cta-lock {
        width: 26px;
        height: 26px;
    }

    .sister-cta-num {
        top: -6px;
        left: -6px;
        width: 26px;
        height: 26px;
        font-size: 13px;
        line-height: 20px;
    }

    .sister-cta-label {
        flex: 1;
        font-size: 14px;
    }
}

/* スマホ: 余白・見出し・ボタンを詰める */
@media (max-width: 640px) {
    .sister-cta {
        padding: 22px 14px 0;
    }

    .sister-cta-title {
        font-size: 21px;
        margin-bottom: 16px;
    }

    .sister-cta-btn {
        width: 100%;
        font-size: 18px;
        padding: 13px 22px 14px;
    }

    .sister-cta-grass {
        flex-direction: column;
        gap: 10px;
        margin: 0 -14px;
        padding: 16px 14px 18px;
    }
}

/* 320px の幅でも主ボタンの「学ぶ」を2行に割らない */
@media (max-width: 360px) {
    .sister-cta-btn {
        gap: 8px;
        font-size: 16px;
        padding: 12px 12px 13px;
        white-space: nowrap;
    }
}

/* レスポンシブ */
@media (max-width: 768px) {
    .features-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .features-block {
        padding: 30px 16px;
    }

    .feature-card {
        padding: 24px 16px 20px;
    }

    .feature-card-img {
        width: 56px;
        height: 56px;
    }
}

/* ====================================== */
/* 2026-10-28 文言・UI の作り直し（三部作の連携後の筋）    */
/* 案: docs/SOZAIBA-COPY-REDESIGN.md                      */
/* ====================================== */

/* 入口: キャッチの2行目（コインなしもある・集めた素材はブレイバー／クラフトで使える） */
.catch-copy-sub {
    margin: -22px 0 26px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, .95), -1px -1px 2px rgba(0, 0, 0, .95), 1px -1px 2px rgba(0, 0, 0, .95), -1px 1px 2px rgba(0, 0, 0, .95);
}

/* 右上の2ボタン: サービス名＋役割の2行（.button-text は flex の子なので、ルビは中の span に） */
/* サービス名はゲームの題名のような太い字に白文字＋ふちどり（<b> なので 1024px 以下のフォントの上書きにかからない） */
.button-service {
    display: block;
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: #fff;
    text-shadow:
        2px 0 0 var(--btn-edge), -2px 0 0 var(--btn-edge), 0 2px 0 var(--btn-edge), 0 -2px 0 var(--btn-edge),
        1.5px 1.5px 0 var(--btn-edge), -1.5px 1.5px 0 var(--btn-edge), 1.5px -1.5px 0 var(--btn-edge), -1.5px -1.5px 0 var(--btn-edge),
        0 3px 0 var(--btn-edge);
}
.button-role {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}
.button-role rt { font-size: 7px; }

/* Screen 2: 「ここの素材はブレイバー／クラフトでそのまま使える」 */
.selection-note {
    max-width: 540px;
    margin: 14px auto 0;
    padding: 8px 14px;
    background: rgba(255, 255, 255, .9);
    border: 2px solid #c58a3c;
    border-radius: 12px;
    color: #2c1810;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

/* カードの札: 🔒は「コインで交換」、コインなしは緑の札 */
.coin-price-label {
    font-size: .8rem;
    font-weight: 700;
    color: #b36b00;
    white-space: nowrap;
}
.material-free-badge {
    padding: 2px 8px;
    border: 1px solid #9fd8b0;
    border-radius: 999px;
    background: #e6f7eb;
    color: #1b7f3b;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}

/* プレビュー: 「この素材を使える場所」（コインなし・交換ずみのときだけ） */
.use-places {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}
.use-place {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.use-place-editor {
    border-color: #f6b73c;
    background: #fff8e6;
}
.use-place-head {
    font-size: .95rem;
    font-weight: 800;
    color: #2c1810;
}
.use-place-editor .use-place-head { color: #b36b00; }
.use-place-body {
    font-size: .85rem;
    line-height: 1.5;
    color: #555;
}

/* 交換の確認: 使える場所の一言と、コインが足りないときの「修行でたまる」 */
.exchange-use-note {
    margin: 4px 0 10px;
    font-size: .9em;
    line-height: 1.5;
    color: #555;
    text-align: center;
}
.exchange-earn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 10px;
    padding: 8px 14px;
    border: 2px solid #f6b73c;
    border-radius: 999px;
    background: #fff3cd;
    color: #7a4b00;
    font-size: .9em;
    font-weight: 700;
    text-decoration: none;
}
.exchange-earn-link img { width: 28px; height: 28px; }
.exchange-earn-link:hover { background: #ffe9a8; }

/* 使い方3ステップの下の「本家 Scratch なら」 */
.seo-steps-note {
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}
.seo-steps-note a {
    color: #ff9a56;
    font-weight: 700;
}

/* カテゴリのページ: 見出しの下の一言 */
.category-lead {
    max-width: 760px;
    margin: 14px auto 0;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    color: #2c1810;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
}

/* 素材の個別ページ: ボタンの上の「使える場所」 */
.use-places-detail {
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 2px solid #f6b73c;
    border-radius: 12px;
    background: #fff8e6;
    color: #5a4a00;
    font-size: .92em;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .button-service { font-size: 13px; }
    .button-role { font-size: 11px; }
    .selection-note { margin-top: 10px; font-size: 12px; }
    .catch-copy-sub { font-size: 13px; }
}

/* カードの下の段: 「コインなしで使える」の札が入っても種類の文字を折らない */
.material-card .material-footer { flex-wrap: wrap; row-gap: 6px; }
.material-card .material-type { white-space: nowrap; }
@media (max-width: 480px) { .catch-copy-sub { margin-top: -14px; } }

/* 使い方3ステップの横: コードブレイバー・コードクラフトで使うなら（2026-10-28 文言の2回目） */
.seo-steps-alt {
    margin-top: 20px;
    padding: 14px 16px;
    border: 2px solid #f6b73c;
    border-radius: 12px;
    background: #fff8e6;
}
.seo-steps-alt-title {
    margin: 0 0 6px;
    font-weight: 800;
    color: #b36b00;
}
.seo-steps-alt p:not(.seo-steps-alt-title) {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

/* ====================================== */
/* 「ようこそ」の画面（Screen 2）の作り直し（2026-10-30 ヒロ） */
/* ====================================== */
/*
 * 背景はそのまま。右上の2ボタンと同じ「ゲームのボタン」の筋で、真ん中の部品をそろえる
 * - 「ようこそ！」: 前のゆらゆら（左右に傾く）をやめ、出てくるときにポンと弾んで、あとはふわふわ浮く。
 *   文字の形に切った光の帯（mask）が走り、まわりで星がまたたく
 * - 「素材を探す」: 紺の板＋金のふちの札にする
 * - 画像・音声: 立体のボタン（画像＝青、音声＝むらさき）。絵は白い丸のメダルに入れる
 * - 検索: 木の枠の絵（searchForm.png）をやめ、白いカプセル＋金色の丸い「→」ボタン
 * ⚠️ 画像・音声のボタンと検索は、素材一覧（Screen 3）でも同じ見た目にする（:is(#screen-selection, #screen-gallery)）。
 *    それ以外はこの画面だけ（#screen-selection）。素材の個別ページなど、ほかのページの部品には効かせない
 * ⚠️ 1024px 以下の「フォントの上書き」（body.fullscreen-body span・h2・rt などに !important）より強くするため、
 *    フォントだけは body.fullscreen-body #screen-selection … に !important を付ける。ルビ（rt）はふつうの字のまま
 * 中身の高さは作り直す前とほぼ同じ（右上の列を隠す高さのしきい値を変えずに済むように）
 */
#screen-selection .selection-content {
    gap: 24px;
}

/* --- 「ようこそ！」 --- */
#screen-selection .welcome-wrap {
    position: relative;
    flex-shrink: 0;
    width: 90%;
    max-width: 500px;
    margin-top: -25px;
    line-height: 0;
}

#screen-selection .welcome-image {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    animation: none;
    filter: drop-shadow(0 5px 0 rgba(22, 12, 64, 0.6)) drop-shadow(0 12px 16px rgba(0, 0, 0, 0.35));
}

/* まわりの星（3つ） */
#screen-selection .welcome-wrap::before {
    content: "";
    position: absolute;
    inset: -16% -6%;
    z-index: 1;
    pointer-events: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.9 7.6 16.4 11.1 24 12C16.4 12.9 12.9 16.4 12 24C11.1 16.4 7.6 12.9 0 12C7.6 11.1 11.1 7.6 12 0Z' fill='%23fff6b0'/%3E%3C/svg%3E") right 1% top 2% / 30px no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.9 7.6 16.4 11.1 24 12C16.4 12.9 12.9 16.4 12 24C11.1 16.4 7.6 12.9 0 12C7.6 11.1 11.1 7.6 12 0Z' fill='%23fff6b0'/%3E%3C/svg%3E") left 2% bottom 8% / 22px no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.9 7.6 16.4 11.1 24 12C16.4 12.9 12.9 16.4 12 24C11.1 16.4 7.6 12.9 0 12C7.6 11.1 11.1 7.6 12 0Z' fill='%23fff6b0'/%3E%3C/svg%3E") left 18% top 0 / 16px no-repeat;
    filter: drop-shadow(0 0 4px rgba(255, 225, 110, 0.95));
    animation: sozaiba-twinkle 2.4s ease-in-out infinite;
    transition: opacity 0.5s ease;
}

/* 文字の形に切った光の帯 */
#screen-selection .welcome-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 54%) 100% 0 / 300% 100% no-repeat;
    -webkit-mask: url("../../image/welcome.png") center / 100% 100% no-repeat;
    mask: url("../../image/welcome.png") center / 100% 100% no-repeat;
    animation: sozaiba-welcome-shine 4.5s ease-in-out 1.2s infinite;
    transition: opacity 0.5s ease;
}

/* 画像・音声を押して消えるとき（sozai.js が img に .fade-out）は、星と光も一緒に消す */
#screen-selection .welcome-wrap:has(> .fade-out)::before,
#screen-selection .welcome-wrap:has(> .fade-out)::after {
    opacity: 0;
}

/* --- 「素材を探す」の札 --- */
body.fullscreen-body #screen-selection .selection-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 8px 32px 5px;
    border: 3px solid #f6c445;
    border-radius: 999px;
    background: linear-gradient(180deg, #3d2c8c 0%, #25185e 55%, #170e40 100%);
    box-shadow:
        0 4px 0 #0e0828,
        0 8px 16px rgba(0, 0, 0, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.25);
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
    font-weight: 400;
    font-size: 26px;
    line-height: 1.25 !important;
    letter-spacing: 0.06em;
    color: #ffe36b;
    -webkit-text-fill-color: #ffe36b !important;
    text-shadow: 0 2px 0 #000, 0 0 10px rgba(255, 210, 80, 0.55) !important;
}

/* 札の左右の金のひし形 */
#screen-selection .selection-title::before,
#screen-selection .selection-title::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -1px;
    background: #f6c445;
    transform: rotate(45deg);
    box-shadow: 0 0 6px rgba(255, 214, 80, 0.9);
}
#screen-selection .selection-title::before { left: 13px; }
#screen-selection .selection-title::after { right: 13px; }

/* 1024px 以下の上書きは ruby にも直接かかるので、ルビの付いた漢字（素材・探・画像・音声）にも同じ字を指定する */
body.fullscreen-body #screen-selection .selection-title ruby,
body.fullscreen-body :is(#screen-selection, #screen-gallery) .selection-button span ruby {
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
}

body.fullscreen-body #screen-selection .selection-title rt {
    font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', Meiryo, sans-serif !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    -webkit-text-fill-color: #fff;
    text-shadow: 0 1px 0 #000;
}

/* --- 画像・音声のボタン --- */
:is(#screen-selection, #screen-gallery) .selection-buttons {
    gap: 28px;
}

:is(#screen-selection, #screen-gallery) .selection-button {
    --sb-edge: #0b2c66;
    --sb-face: linear-gradient(180deg, #d2f3ff 0%, #6fd0ff 32%, #23a0f2 64%, #0c6fd1 100%);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 196px;
    height: 90px;
    padding: 0 14px 0 12px;
    box-sizing: border-box;
    border: 3px solid var(--sb-edge);
    border-radius: 22px;
    background: var(--sb-face);
    box-shadow:
        0 6px 0 var(--sb-edge),
        0 12px 20px rgba(0, 0, 0, 0.35),
        inset 0 3px 0 rgba(255, 255, 255, 0.75),
        inset 0 -6px 0 rgba(0, 0, 0, 0.14);
    filter: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

:is(#screen-selection, #screen-gallery) .selection-button:is([data-type="audio"], [data-type="sound"]) {
    --sb-edge: #2c0f6e;
    --sb-face: linear-gradient(180deg, #f1dcff 0%, #c08bff 32%, #9255f5 64%, #6a2fd6 100%);
}

/* ななめの光の帯（右上の2ボタンと同じ動き。画像と音声で半分ずらす） */
:is(#screen-selection, #screen-gallery) .selection-button::before {
    content: "";
    position: absolute;
    top: -30%;
    bottom: -30%;
    left: 0;
    width: 34%;
    height: auto;
    z-index: 2;
    border-radius: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 38%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0.3) 62%, rgba(255, 255, 255, 0) 100%);
    transform: translateX(-140%) skewX(-22deg);
    animation: sozaiba-btn-shine 5s ease-in-out 1.2s infinite;
    transition: none;
    pointer-events: none;
}
:is(#screen-selection, #screen-gallery) .selection-button:is([data-type="audio"], [data-type="sound"])::before {
    animation-delay: 3.7s;
}

:is(#screen-selection, #screen-gallery) .selection-button img {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    box-sizing: border-box;
    padding: 7px;
    object-fit: contain;
    border: 3px solid var(--sb-edge);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #ffffff 0%, #f3f7ff 60%, #d5e4ff 100%);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

body.fullscreen-body :is(#screen-selection, #screen-gallery) .selection-button span {
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
    font-weight: 400;
    font-size: 34px;
    line-height: 1;
    color: #fff;
    -webkit-text-fill-color: #fff;
    text-shadow:
        2.5px 0 0 var(--sb-edge), -2.5px 0 0 var(--sb-edge), 0 2.5px 0 var(--sb-edge), 0 -2.5px 0 var(--sb-edge),
        2px 2px 0 var(--sb-edge), -2px 2px 0 var(--sb-edge), 2px -2px 0 var(--sb-edge), -2px -2px 0 var(--sb-edge),
        0 4px 0 var(--sb-edge);
}

body.fullscreen-body :is(#screen-selection, #screen-gallery) .selection-button span ruby rt {
    top: -16px;
    font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', Meiryo, sans-serif !important;
    font-size: 13px;
    font-weight: 800;
    -webkit-text-fill-color: #fff;
    text-shadow: 1px 1px 0 var(--sb-edge), -1px 1px 0 var(--sb-edge), 1px -1px 0 var(--sb-edge), -1px -1px 0 var(--sb-edge);
}

:is(#screen-selection, #screen-gallery) .selection-button:hover {
    transform: translateY(-3px);
    filter: brightness(1.07) saturate(1.1);
    box-shadow:
        0 9px 0 var(--sb-edge),
        0 16px 24px rgba(0, 0, 0, 0.38),
        inset 0 3px 0 rgba(255, 255, 255, 0.75),
        inset 0 -6px 0 rgba(0, 0, 0, 0.14);
}

:is(#screen-selection, #screen-gallery) .selection-button:active {
    transform: translateY(5px);
    filter: none;
    box-shadow:
        0 1px 0 var(--sb-edge),
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 3px 0 rgba(255, 255, 255, 0.75),
        inset 0 -6px 0 rgba(0, 0, 0, 0.14);
}

:is(#screen-selection, #screen-gallery) .selection-button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* --- 検索 --- */
#screen-selection .search-form-wrapper {
    width: 100%;
    max-width: 420px;
    margin-top: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 検索の色（素材一覧で画像を出しているときは、下の Screen 3 の節で青に替える） */
:is(#screen-selection, #screen-gallery) {
    --search-edge: #1d1446;
    --search-face: #f4f1ff;
    --search-shade: rgba(29, 20, 70, 0.15);
    --search-ink: #241a52;
    --search-hint: #8d86ad;
    --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='none' stroke='%237a6fae' stroke-width='3'/%3E%3Cpath d='M15 15l6 6' stroke='%237a6fae' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

:is(#screen-selection, #screen-gallery) .search-form-bg {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 58px;
    margin: 0;
    padding: 0 6px 0 50px;
    box-sizing: border-box;
    border: 3px solid var(--search-edge);
    border-radius: 999px;
    background:
        var(--search-icon) 17px 50% / 24px no-repeat,
        linear-gradient(180deg, #ffffff 0%, var(--search-face) 100%);
    box-shadow:
        0 5px 0 var(--search-edge),
        0 10px 18px rgba(0, 0, 0, 0.35),
        inset 0 3px 5px var(--search-shade);
    transition: box-shadow 0.15s ease;
}

:is(#screen-selection, #screen-gallery) .search-form-bg:focus-within {
    box-shadow:
        0 5px 0 var(--search-edge),
        0 10px 18px rgba(0, 0, 0, 0.35),
        inset 0 3px 5px var(--search-shade),
        0 0 0 4px rgba(255, 214, 74, 0.9);
}

:is(#screen-selection, #screen-gallery) :is(#searchInputSelection, #search-input) {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 4px;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    color: var(--search-ink);
}

:is(#screen-selection, #screen-gallery) :is(#searchInputSelection, #search-input)::placeholder {
    color: var(--search-hint);
    font-weight: 600;
    opacity: 1;
}

/* 金色の丸い「→」（中の絵 searchSubmitButton.png は使わない。ボタンの名前は aria-label） */
:is(#screen-selection, #screen-gallery) :is(#searchSubmitButton, #searchSubmitButtonGallery) {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    box-sizing: border-box;
    border: 3px solid #6b3300;
    border-radius: 50%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h12M12.5 6.5L18 12l-5.5 5.5' fill='none' stroke='%236b3300' stroke-width='6.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 12h12M12.5 6.5L18 12l-5.5 5.5' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 26px no-repeat,
        linear-gradient(180deg, #fff1a0 0%, #ffd23f 42%, #ffa000 100%);
    box-shadow: 0 3px 0 #6b3300, inset 0 2px 0 rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

:is(#screen-selection, #screen-gallery) :is(#searchSubmitButton, #searchSubmitButtonGallery):hover {
    transform: translateY(-1px) scale(1.06);
}

:is(#screen-selection, #screen-gallery) :is(#searchSubmitButton, #searchSubmitButtonGallery):active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #6b3300, inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

:is(#screen-selection, #screen-gallery) :is(#searchSubmitButton, #searchSubmitButtonGallery):focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

:is(#screen-selection, #screen-gallery) :is(#searchSubmitButton, #searchSubmitButtonGallery) img {
    display: none;
}

/* --- 画面が出てきたときの登場（.active が付くたびに流れる） --- */
#screen-selection.active .welcome-wrap {
    animation:
        sozaiba-welcome-pop 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) backwards,
        sozaiba-welcome-float 3.2s ease-in-out 0.7s infinite;
}
#screen-selection.active .selection-title {
    animation: sozaiba-rise 0.5s ease-out 0.25s backwards;
}
#screen-selection.active .selection-button {
    animation: sozaiba-btn-pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 0.35s backwards;
}
#screen-selection.active .selection-button:is([data-type="audio"], [data-type="sound"]) {
    animation-delay: 0.45s;
}
#screen-selection.active .search-form-wrapper {
    animation: sozaiba-rise 0.5s ease-out 0.55s backwards;
}

@keyframes sozaiba-welcome-pop {
    0% { opacity: 0; transform: translateY(-24px) scale(0.6); }
    100% { opacity: 1; transform: none; }
}
@keyframes sozaiba-welcome-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes sozaiba-welcome-shine {
    0%, 60% { background-position: 100% 0; }
    85%, 100% { background-position: 0% 0; }
}
@keyframes sozaiba-twinkle {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}
@keyframes sozaiba-rise {
    0% { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: none; }
}
@keyframes sozaiba-btn-pop {
    0% { opacity: 0; transform: scale(0.7); }
    100% { opacity: 1; transform: none; }
}

/* 動きを減らす設定の人には、登場・浮く・光・星を出さない */
@media (prefers-reduced-motion: reduce) {
    #screen-selection.active .welcome-wrap,
    #screen-selection.active .selection-title,
    #screen-selection.active .selection-button,
    #screen-selection.active .search-form-wrapper,
    #screen-selection .welcome-wrap::before,
    #screen-selection .welcome-wrap::after,
    :is(#screen-selection, #screen-gallery) .selection-button::before {
        animation: none;
    }
    #screen-selection .welcome-wrap::after,
    :is(#screen-selection, #screen-gallery) .selection-button::before {
        display: none;
    }
}

/* タブレット（768px 以下） */
@media (max-width: 768px) {
    #screen-selection .selection-content { gap: 18px; }
    #screen-selection .welcome-wrap { max-width: 280px; margin-top: -15px; }
    body.fullscreen-body #screen-selection .selection-title { padding: 7px 28px 4px; font-size: 22px; }
    :is(#screen-selection, #screen-gallery) .selection-buttons { gap: 22px; }
    :is(#screen-selection, #screen-gallery) .selection-button { width: 158px; height: 76px; gap: 8px; padding: 0 10px; border-radius: 18px; }
    :is(#screen-selection, #screen-gallery) .selection-button img { width: 44px; height: 44px; padding: 6px; }
    body.fullscreen-body :is(#screen-selection, #screen-gallery) .selection-button span { font-size: 27px; }
    body.fullscreen-body :is(#screen-selection, #screen-gallery) .selection-button span ruby rt { font-size: 11px; }
    #screen-selection .search-form-wrapper { max-width: 360px; }
    :is(#screen-selection, #screen-gallery) .search-form-bg { height: 54px; }
    :is(#screen-selection, #screen-gallery) :is(#searchInputSelection, #search-input) { font-size: 17px; }
}

/* スマホ（480px 以下） */
@media (max-width: 480px) {
    #screen-selection .selection-content { gap: 14px; }
    #screen-selection .welcome-wrap { max-width: 220px; margin-top: -10px; }
    #screen-selection .welcome-wrap::before { background-size: 22px, 16px, 12px; }
    body.fullscreen-body #screen-selection .selection-title { padding: 6px 24px 3px; font-size: 19px; border-width: 2px; }
    #screen-selection .selection-title::before { left: 10px; }
    #screen-selection .selection-title::after { right: 10px; }
    #screen-selection .selection-title::before,
    #screen-selection .selection-title::after { width: 6px; height: 6px; }
    body.fullscreen-body #screen-selection .selection-title rt { font-size: 9px; }
    :is(#screen-selection, #screen-gallery) .selection-buttons { gap: 16px; }
    :is(#screen-selection, #screen-gallery) .selection-button { width: 130px; height: 66px; gap: 6px; padding: 0 8px; border-radius: 16px; }
    :is(#screen-selection, #screen-gallery) .selection-button img { width: 36px; height: 36px; padding: 4px; border-width: 2px; }
    body.fullscreen-body :is(#screen-selection, #screen-gallery) .selection-button span { font-size: 22px; }
    body.fullscreen-body :is(#screen-selection, #screen-gallery) .selection-button span ruby rt { font-size: 9px; }
    #screen-selection .search-form-wrapper { max-width: 290px; }
    :is(#screen-selection, #screen-gallery) .search-form-bg { height: 50px; padding: 0 5px 0 42px; background-position: 14px 50%, 0 0; background-size: 20px, auto; }
    :is(#screen-selection, #screen-gallery) :is(#searchInputSelection, #search-input) { font-size: 15px; }
    :is(#screen-selection, #screen-gallery) :is(#searchSubmitButton, #searchSubmitButtonGallery) { width: 38px; height: 38px; background-size: 22px, auto; }
}

/* 320px など（スクロールバーが幅を取るパソコンの狭い窓も）: 画像・音声が2段に折れないように */
@media (max-width: 360px) {
    :is(#screen-selection, #screen-gallery) .selection-buttons { gap: 12px; }
    :is(#screen-selection, #screen-gallery) .selection-button { width: 120px; }
    :is(#screen-selection, #screen-gallery) .selection-button img { width: 32px; height: 32px; }
}

/* ====================================== */
/* 素材一覧の画面（Screen 3）の作り直し（2026-10-30 ヒロ） */
/* ====================================== */
/*
 * 「ようこそ」の画面と同じ「ゲームのボタン」の筋。背景の木目はそのまま
 * - カテゴリー（人気・キャラクター…）: 紺の立体の札。選んでいるものは金色（木の枠の絵 buttonFlame.png はやめた）
 * - 「人気の画像素材 28件」: 紺の板＋金のふちの札（「素材を探す」と同じ）
 * - 素材のカード: 紺の太いふち＋下の厚み。乗せると浮く。絵の台は明るい舞台、コインの素材は内側に金のふち
 * - 音の素材: 夜空の色のプレーヤー＋金色の再生ボタン
 * - コインの値段は金色の札、「もっと見る」は金色の立体のボタン、タグの絞り込みは白い札（選ぶと青）
 * 画像・音声の切り替えと検索は、上の「ようこそ」の節の指定がそのままかかる
 * ⚠️ 指定は必ず #screen-gallery から書く（素材の個別ページ・カテゴリのページも .material-card などを使う）
 * ⚠️ カテゴリのページ・素材の個別ページ（SEO ページ。_includes/header.php の #sozaiba-seo）にも同じ見た目を出すので、
 *    各指定には #sozaiba-seo のセレクタも並べてある（2026-11-11）。指定を足す・直すときは両方そろえる。
 *    「body.fullscreen-body #screen-gallery …」は SEO ページでは「#sozaiba-seo …」。画像の色は #sozaiba-seo[data-media="image"]
 *    SEO ページだけの部分（見出し・パンくず・説明欄・個別ページ）は、このファイルの最後の節
 * ⚠️ 1024px 以下の「フォントの上書き」より強くするため、字の指定だけ body.fullscreen-body #screen-gallery … に !important
 *
 * 色: 音声を出しているときは紫、画像を出しているときはうすめの青（2026-10-30 ヒロ）
 * - 色は下の --g-*（と検索の --search-*）で持ち、画像のときだけ値を入れ替える
 * - 「いま画像か」は、カテゴリーにキャラクター（data-category="sprites"）があるかで見る。
 *   sozai.js はカテゴリーを、一覧を描く前・画面が切り替わる前に作り直すので、色が遅れて変わらない
 *   （画像・音声の切り替えボタンは画面が出たあとに作られるので、そちらでは見ない）
 */
#screen-gallery,
#sozaiba-seo {
    --g-edge: #120a33;          /* 札のふち・厚み */
    --g-ink: #261868;           /* 白い札の字 */
    --g-pill-face: linear-gradient(180deg, #5a48b8 0%, #3a2a8c 52%, #261868 100%);
    --g-plate-face: linear-gradient(180deg, #3d2c8c 0%, #25185e 55%, #170e40 100%);
    --g-plate-shadow: #0e0828;
    --g-card-edge: #1d1446;     /* カードのふち・名前の字 */
    --g-stage: radial-gradient(circle at 50% 38%, #ffffff 0%, #f1efff 52%, #d9d6f5 100%);
    --g-floor: rgba(29, 20, 70, 0.18);
    --g-chip-face: linear-gradient(180deg, #ffffff 0%, #ece8ff 100%);
    --g-tag-bg: #f1eeff;
    --g-tag-line: #c9c0f5;
    --g-tag-ink: #3d2c8c;
    --g-dash: #e2ddff;
    --g-badge-face: linear-gradient(180deg, #c9a6ff 0%, #9255f5 45%, #6a2fd6 100%);
    --g-badge-edge: #2c0f6e;
}

/* 画像を出しているとき: うすめの青 */
#screen-gallery:has(#category-pills .category-pill[data-category="sprites"]),
#sozaiba-seo[data-media="image"] {
    --g-edge: #123f86;
    --g-ink: #1a4a9a;
    --g-pill-face: linear-gradient(180deg, #7dbafa 0%, #4b90ea 52%, #2f6fd2 100%);
    --g-plate-face: linear-gradient(180deg, #4b8fe6 0%, #2f6dcb 55%, #1f51a6 100%);
    --g-plate-shadow: #0f3373;
    --g-card-edge: #1b468c;
    --g-stage: radial-gradient(circle at 50% 38%, #ffffff 0%, #f0f7ff 52%, #d6e7fb 100%);
    --g-floor: rgba(27, 70, 140, 0.16);
    --g-chip-face: linear-gradient(180deg, #ffffff 0%, #e6f1ff 100%);
    --g-tag-bg: #ecf4ff;
    --g-tag-line: #b9d4f6;
    --g-tag-ink: #2a64c4;
    --g-dash: #d8e8fb;
    --g-badge-face: linear-gradient(180deg, #bcd8ff 0%, #5b9af5 45%, #3170e0 100%);
    --g-badge-edge: #123f86;
    --search-edge: #1b468c;
    --search-face: #eef5ff;
    --search-shade: rgba(27, 70, 140, 0.15);
    --search-ink: #163d80;
    --search-hint: #7f9cc4;
    --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='none' stroke='%235b8fd0' stroke-width='3'/%3E%3Cpath d='M15 15l6 6' stroke='%235b8fd0' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* --- カテゴリー（上と、もっと見るの下の2か所） --- */
#screen-gallery .category-pills,
#sozaiba-seo .category-pills {
    gap: 10px;
}

#screen-gallery .category-pill,
#sozaiba-seo .category-pill {
    min-height: 46px;
    padding: 4px 18px 2px;
    box-sizing: border-box;
    border: 3px solid var(--g-edge);
    border-radius: 999px;
    background: var(--g-pill-face);
    box-shadow:
        0 4px 0 var(--g-edge),
        0 7px 12px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 0 var(--g-edge);
    filter: none;
    transform: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

body.fullscreen-body #screen-gallery .category-pill,
body.fullscreen-body #screen-gallery .category-pill ruby,
#sozaiba-seo .category-pill,
#sozaiba-seo .category-pill ruby {
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
    font-weight: 400;
}

body.fullscreen-body #screen-gallery .category-pill rt,
#sozaiba-seo .category-pill rt {
    font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', Meiryo, sans-serif !important;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
}

#screen-gallery .category-pill:hover,
#sozaiba-seo .category-pill:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
    box-shadow:
        0 6px 0 var(--g-edge),
        0 10px 14px rgba(0, 0, 0, 0.32),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

#screen-gallery .category-pill:active,
#sozaiba-seo .category-pill:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--g-edge), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

/* 選んでいるカテゴリーは金色 */
#screen-gallery .category-pill.active,
#sozaiba-seo .category-pill.active {
    border-color: #6b3300;
    background: linear-gradient(180deg, #fff6b8 0%, #ffd84a 40%, #ffb300 75%, #ff9500 100%);
    box-shadow:
        0 4px 0 #6b3300,
        0 0 0 3px rgba(255, 236, 140, 0.55),
        0 8px 16px rgba(0, 0, 0, 0.32),
        inset 0 2px 0 rgba(255, 255, 255, 0.75);
    color: #4a2200;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
    transform: none;
    filter: none;
}

#screen-gallery .category-pill:focus-visible,
#sozaiba-seo .category-pill:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* --- 「人気の画像素材 28件」の札 --- */
body.fullscreen-body #screen-gallery .materials-count-text,
#sozaiba-seo .materials-count-text {
    display: inline-block;
    padding: 9px 22px 6px;
    border: 3px solid #f6c445;
    border-radius: 18px;
    background: var(--g-plate-face);
    box-shadow:
        0 4px 0 var(--g-plate-shadow),
        0 8px 16px rgba(0, 0, 0, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.25);
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
    font-weight: 400;
    font-size: 21px;
    line-height: 1.35;
    letter-spacing: 0.03em;
    color: #ffe36b;
    -webkit-text-fill-color: #ffe36b;
    text-shadow: 0 2px 0 #000, 0 0 10px rgba(255, 210, 80, 0.5);
}

body.fullscreen-body #screen-gallery .materials-count-text ruby,
#sozaiba-seo .materials-count-text ruby {
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
}

body.fullscreen-body #screen-gallery .materials-count-text rt,
#sozaiba-seo .materials-count-text rt {
    font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', Meiryo, sans-serif !important;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    -webkit-text-fill-color: #fff;
    text-shadow: 0 1px 0 #000;
}

/* コインの絞り込み（コインなしで使える・コードブレイバー素材…） */
#screen-gallery .coin-filter-pill,
#sozaiba-seo .coin-filter-pill {
    padding: 6px 14px 4px;
    border: 2px solid var(--g-edge);
    border-radius: 999px;
    background: var(--g-chip-face);
    box-shadow: 0 3px 0 var(--g-edge), 0 5px 10px rgba(0, 0, 0, 0.25);
    color: var(--g-ink);
    -webkit-text-fill-color: var(--g-ink);
    text-shadow: none;
    font-weight: 800;
    transform: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#screen-gallery .coin-filter-pill:hover,
#sozaiba-seo .coin-filter-pill:hover {
    transform: translateY(-2px);
    background: var(--g-chip-face);
    box-shadow: 0 5px 0 var(--g-edge), 0 7px 12px rgba(0, 0, 0, 0.28);
}

#screen-gallery .coin-filter-pill.active,
#sozaiba-seo .coin-filter-pill.active {
    border-color: #6b3300;
    background: linear-gradient(180deg, #fff6b8 0%, #ffd84a 45%, #ffa000 100%);
    box-shadow: 0 3px 0 #6b3300, 0 0 0 3px rgba(255, 236, 140, 0.55);
    color: #4a2200;
    -webkit-text-fill-color: #4a2200;
    text-shadow: none;
}

#screen-gallery .clear-filter-btn,
#sozaiba-seo .clear-filter-btn {
    padding: 7px 16px 6px;
    border: 2px solid #6b0f1a;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff9a9a 0%, #ff5a5a 45%, #e0303a 100%);
    box-shadow: 0 3px 0 #6b0f1a, 0 5px 10px rgba(0, 0, 0, 0.25);
    color: #fff;
    text-shadow: 0 1px 0 #6b0f1a;
    transform: none;
}

#screen-gallery .clear-filter-btn:hover,
#sozaiba-seo .clear-filter-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #ff9a9a 0%, #ff5a5a 45%, #e0303a 100%);
    box-shadow: 0 5px 0 #6b0f1a, 0 7px 12px rgba(0, 0, 0, 0.28);
}

/* --- タグの絞り込み（音の素材・アイテム） --- */
body.fullscreen-body #screen-gallery .tag-filter-label,
#sozaiba-seo .tag-filter-label {
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
    font-weight: 400;
    font-size: 17px;
    color: #ffe36b;
    -webkit-text-fill-color: #ffe36b;
    text-shadow: 2px 0 0 var(--g-edge), -2px 0 0 var(--g-edge), 0 2px 0 var(--g-edge), 0 -2px 0 var(--g-edge), 0 3px 0 var(--g-edge);
}

body.fullscreen-body #screen-gallery .tag-filter-label ruby,
#sozaiba-seo .tag-filter-label ruby {
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
}

body.fullscreen-body #screen-gallery .tag-filter-label rt,
#sozaiba-seo .tag-filter-label rt {
    font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', Meiryo, sans-serif !important;
    font-size: 9px;
    text-shadow: 0 1px 0 var(--g-edge);
}

#screen-gallery .tag-checkboxes,
#sozaiba-seo .tag-checkboxes {
    gap: 10px;
}

#screen-gallery .tag-checkbox-label,
#sozaiba-seo .tag-checkbox-label {
    padding: 7px 15px 5px;
    border: 2px solid var(--g-edge);
    border-radius: 999px;
    background: var(--g-chip-face);
    box-shadow: 0 3px 0 var(--g-edge), 0 5px 10px rgba(0, 0, 0, 0.25);
    color: var(--g-ink);
    font-weight: 800;
    transform: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#screen-gallery .tag-checkbox-label:hover,
#sozaiba-seo .tag-checkbox-label:hover {
    border-color: var(--g-edge);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--g-edge), 0 7px 12px rgba(0, 0, 0, 0.28);
}

#screen-gallery .tag-checkbox-label:has(input[type="checkbox"]:checked),
#sozaiba-seo .tag-checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: #0b2c66;
    background: linear-gradient(180deg, #d2f3ff 0%, #6fd0ff 35%, #23a0f2 70%, #0c6fd1 100%);
    box-shadow: 0 3px 0 #0b2c66, 0 0 0 3px rgba(150, 220, 255, 0.5);
    color: #fff;
    text-shadow: 0 1px 0 #0b2c66;
}

/* --- 素材のカード --- */
#screen-gallery .materials-grid,
#sozaiba-seo .materials-grid {
    gap: 26px;
}

#screen-gallery .material-card,
#sozaiba-seo .material-card {
    border: 3px solid var(--g-card-edge);
    border-radius: 20px;
    background: #fff;
    box-shadow:
        0 6px 0 var(--g-card-edge),
        0 12px 22px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#screen-gallery .material-card:hover,
#sozaiba-seo .material-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 0 var(--g-card-edge),
        0 18px 28px rgba(0, 0, 0, 0.38);
}

/* コインで交換する素材: 外は茶、内側に金のふち（outline は中身の上に描かれる） */
#screen-gallery .material-card.premium-coin,
#sozaiba-seo .material-card.premium-coin {
    border-color: #6b3300;
    outline: 3px solid #ffc83a;
    outline-offset: -6px;
    box-shadow:
        0 6px 0 #6b3300,
        0 12px 22px rgba(0, 0, 0, 0.35);
}

#screen-gallery .material-card.premium-coin:hover,
#sozaiba-seo .material-card.premium-coin:hover {
    border-color: #6b3300;
    box-shadow:
        0 10px 0 #6b3300,
        0 0 0 4px rgba(255, 214, 74, 0.45),
        0 18px 28px rgba(0, 0, 0, 0.38);
}

/* 絵の台（明るい舞台。キャラとアイテムは足もとにうすい影） */
#screen-gallery .material-thumbnail,
#sozaiba-seo .material-thumbnail {
    border-bottom: 3px solid var(--g-card-edge);
    background:
        radial-gradient(ellipse 34% 7% at 50% 93%, var(--g-floor) 0%, transparent 100%),
        var(--g-stage);
}

#screen-gallery .material-card.premium-coin .material-thumbnail,
#sozaiba-seo .material-card.premium-coin .material-thumbnail {
    border-bottom-color: #6b3300;
}

/* コスチュームの数の札 */
#screen-gallery .costume-badge,
#sozaiba-seo .costume-badge {
    left: 10px;
    bottom: 10px;
    padding: 4px 12px 3px;
    border: 2px solid var(--g-badge-edge);
    border-radius: 999px;
    background: var(--g-badge-face);
    box-shadow: 0 3px 0 var(--g-badge-edge), 0 4px 8px rgba(0, 0, 0, 0.25);
    font-weight: 800;
    text-shadow: 0 1px 0 var(--g-badge-edge);
}

/* 音の素材のプレーヤー: 夜空の色＋金色の再生ボタン */
#screen-gallery .sound-thumbnail-player,
#sozaiba-seo .sound-thumbnail-player {
    box-sizing: border-box;
    background:
        radial-gradient(circle at 50% 30%, rgba(140, 120, 255, 0.45) 0%, rgba(140, 120, 255, 0) 55%),
        linear-gradient(180deg, #3d2c8c 0%, #25185e 60%, #170e40 100%);
}

/* 音符: 絵文字（🎵）は端末で色が変わり、紫だと青い夜空に沈むので、明るい音符の絵に替える（文字は font-size: 0 で隠す） */
#screen-gallery .thumbnail-audio-icon,
#sozaiba-seo .thumbnail-audio-icon {
    width: 60px;
    height: 60px;
    margin: 2px auto 0;
    font-size: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23fff3b0'%3E%3Cpath d='M23 14L54 7v10l-31 7z'/%3E%3Crect x='22' y='14' width='5.5' height='35' rx='1'/%3E%3Crect x='49' y='8' width='5.5' height='35' rx='1'/%3E%3Cellipse cx='17' cy='49' rx='10' ry='7.5' transform='rotate(-20 17 49)'/%3E%3Cellipse cx='44' cy='43' rx='10' ry='7.5' transform='rotate(-20 44 43)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    filter: drop-shadow(0 0 8px rgba(255, 214, 90, 0.9)) drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45));
}

#screen-gallery .thumbnail-play-btn,
#sozaiba-seo .thumbnail-play-btn {
    width: 46px;
    height: 46px;
    box-sizing: border-box;
    border: 3px solid #6b3300;
    background: linear-gradient(180deg, #fff1a0 0%, #ffd23f 42%, #ffa000 100%);
    box-shadow: 0 3px 0 #6b3300, inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

#screen-gallery .thumbnail-play-btn:hover,
#sozaiba-seo .thumbnail-play-btn:hover {
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 4px 0 #6b3300, 0 0 12px rgba(255, 214, 74, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

#screen-gallery .thumbnail-play-btn:active,
#sozaiba-seo .thumbnail-play-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #6b3300, inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

/* 再生・止めるの形は茶色（白だと金の上で見えにくい） */
#screen-gallery .thumbnail-play-icon::before,
#sozaiba-seo .thumbnail-play-icon::before {
    border-color: transparent transparent transparent #5a2a00;
}
#screen-gallery .thumbnail-play-icon.pause::before,
#sozaiba-seo .thumbnail-play-icon.pause::before {
    background: #5a2a00;
}
#screen-gallery .thumbnail-play-icon.loading::before,
#sozaiba-seo .thumbnail-play-icon.loading::before {
    border-color: rgba(90, 42, 0, 0.3);
    border-top-color: #5a2a00;
}

#screen-gallery .thumbnail-time-display,
#sozaiba-seo .thumbnail-time-display {
    color: #fff;
    text-shadow: 0 1px 0 #000;
}

#screen-gallery .thumbnail-progress-bar-container,
#sozaiba-seo .thumbnail-progress-bar-container {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

#screen-gallery .thumbnail-progress-bar,
#sozaiba-seo .thumbnail-progress-bar {
    background: linear-gradient(90deg, #ffe36b 0%, #ffa000 100%);
}

/*
 * 値段・鍵（コインなしの素材は下の段）を、カードのいちばん下にそろえる（2026-10-30 ヒロ）
 * グリッドは同じ段のカードを同じ高さにのばすので、下に寄せれば名前やタグの行数がちがっても隣と高さが合う
 */
#screen-gallery .material-card,
#sozaiba-seo .material-card {
    display: flex;
    flex-direction: column;
}

#screen-gallery .material-card .material-thumbnail,
#sozaiba-seo .material-card .material-thumbnail {
    flex-shrink: 0;
}

#screen-gallery .material-card .material-info,
#sozaiba-seo .material-card .material-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

#screen-gallery .material-card .premium-coin-display,
#screen-gallery .material-card .material-footer,
#sozaiba-seo .material-card .premium-coin-display,
#sozaiba-seo .material-card .material-footer {
    margin-top: auto;
}

/* 名前・タグ */
#screen-gallery .material-card .material-info,
#sozaiba-seo .material-card .material-info {
    padding: 14px 16px 16px;
}

#screen-gallery .material-card .material-title,
#sozaiba-seo .material-card .material-title {
    margin-bottom: 4px;
    color: var(--g-card-edge);
    font-size: 17px;
    font-weight: 800;
}

#screen-gallery .material-card .material-tag,
#sozaiba-seo .material-card .material-tag {
    padding: 3px 10px;
    border: 1.5px solid var(--g-tag-line);
    border-radius: 999px;
    background: var(--g-tag-bg);
    color: var(--g-tag-ink);
    font-weight: 700;
}

#screen-gallery .material-card .material-tag:hover,
#sozaiba-seo .material-card .material-tag:hover {
    border-color: var(--g-ink);
    background: var(--g-tag-ink);
    color: #fff;
    box-shadow: 0 2px 0 var(--g-edge);
}

/* コインの値段の札 */
#screen-gallery .premium-coin-display,
#sozaiba-seo .premium-coin-display {
    gap: 10px;
    padding: 6px 0 0;
}

#screen-gallery .coin-price-row,
#sozaiba-seo .coin-price-row {
    gap: 6px;
    padding: 3px 16px 3px 4px;
    border: 2px solid #8a4b00;
    border-radius: 999px;
    background: linear-gradient(180deg, #fffbe6 0%, #ffe9a0 100%);
    box-shadow: 0 3px 0 #8a4b00, inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#screen-gallery .coin-icon-large,
#sozaiba-seo .coin-icon-large {
    width: 34px;
    height: 34px;
}

body.fullscreen-body #screen-gallery .coin-price-text,
#sozaiba-seo .coin-price-text {
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
    font-weight: 400;
    font-size: 24px;
    color: #a85a00;
}

#screen-gallery .coin-price-label,
#sozaiba-seo .coin-price-label {
    color: #7a4100;
    font-weight: 800;
}

/* 鍵（image/coinLock.svg。カテゴリのページは前の木の鍵 shopKey.png のまま）。カードに乗せると「開けて」とゆれる */
#screen-gallery .shop-key-img,
#sozaiba-seo .shop-key-img {
    width: 52px;
    height: auto;
    transform-origin: 50% 30%;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.18)) drop-shadow(0 0 6px rgba(255, 214, 74, 0.55));
}

#screen-gallery .material-card.premium-coin:hover .shop-key-img,
#sozaiba-seo .material-card.premium-coin:hover .shop-key-img {
    animation: sozaiba-lock-wiggle 0.6s ease-in-out;
}

@keyframes sozaiba-lock-wiggle {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-6deg); }
    80% { transform: rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
    #screen-gallery .material-card.premium-coin:hover .shop-key-img, #sozaiba-seo .material-card.premium-coin:hover .shop-key-img { animation: none; }
}

/* コインなしの素材の下の段 */
#screen-gallery .material-card .material-footer,
#sozaiba-seo .material-card .material-footer {
    border-top: 2px dashed var(--g-dash);
}

#screen-gallery .material-free-badge,
#sozaiba-seo .material-free-badge {
    padding: 3px 10px;
    border: 2px solid #1b7f3b;
    background: linear-gradient(180deg, #eafff0 0%, #c8f5d6 100%);
    box-shadow: 0 2px 0 #1b7f3b;
    font-weight: 800;
}

/* --- もっと見る --- */
#screen-gallery .load-more-btn,
#sozaiba-seo .load-more-btn {
    padding: 13px 36px 11px;
    border: 3px solid #6b3300;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff6b8 0%, #ffd84a 40%, #ffb300 75%, #ff9500 100%);
    box-shadow:
        0 6px 0 #6b3300,
        0 12px 20px rgba(0, 0, 0, 0.35),
        inset 0 3px 0 rgba(255, 255, 255, 0.75);
    color: #4a2200;
    font-size: 19px;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

body.fullscreen-body #screen-gallery .load-more-btn,
#sozaiba-seo .load-more-btn {
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif !important;
    font-weight: 400;
}

#screen-gallery .load-more-btn:hover,
#sozaiba-seo .load-more-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.05);
    box-shadow:
        0 9px 0 #6b3300,
        0 16px 24px rgba(0, 0, 0, 0.38),
        inset 0 3px 0 rgba(255, 255, 255, 0.75);
}

#screen-gallery .load-more-btn:active,
#sozaiba-seo .load-more-btn:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #6b3300, inset 0 3px 0 rgba(255, 255, 255, 0.75);
}

#screen-gallery .load-more-btn:focus-visible,
#sozaiba-seo .load-more-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* 一覧の画像・音声の切り替えは1つだけなので、少し小さく（ルビが上のふちで切れないよう字も少し小さく） */
#screen-gallery .selection-button {
    width: 176px;
    height: 80px;
}

body.fullscreen-body #screen-gallery .selection-button span {
    font-size: 30px;
}

body.fullscreen-body #screen-gallery .selection-button span ruby rt {
    top: -13px;
    font-size: 12px;
}

/* タブレット（768px 以下） */
@media (max-width: 768px) {
    #screen-gallery .category-pill, #sozaiba-seo .category-pill { min-height: 40px; padding: 3px 14px 1px; font-size: 14px; }
    body.fullscreen-body #screen-gallery .materials-count-text, #sozaiba-seo .materials-count-text { padding: 7px 18px 5px; font-size: 18px; }
    #screen-gallery .materials-grid, #sozaiba-seo .materials-grid { gap: 20px; }
    #screen-gallery .selection-button { width: 150px; height: 70px; }
    body.fullscreen-body #screen-gallery .selection-button span { font-size: 25px; }
    body.fullscreen-body #screen-gallery .selection-button span ruby rt { font-size: 10px; }
}

/* スマホ（480px 以下） */
@media (max-width: 480px) {
    #screen-gallery .category-pills, #sozaiba-seo .category-pills { gap: 7px; }
    #screen-gallery .category-pill, #sozaiba-seo .category-pill { min-height: 36px; padding: 3px 11px 1px; border-width: 2px; font-size: 13px; }
    body.fullscreen-body #screen-gallery .category-pill rt, #sozaiba-seo .category-pill rt { font-size: 8px; }
    body.fullscreen-body #screen-gallery .materials-count-text, #sozaiba-seo .materials-count-text { padding: 6px 14px 4px; border-width: 2px; border-radius: 14px; font-size: 15px; }
    body.fullscreen-body #screen-gallery .materials-count-text rt, #sozaiba-seo .materials-count-text rt { font-size: 8px; }
    #screen-gallery .materials-grid, #sozaiba-seo .materials-grid { gap: 14px; }
    #screen-gallery .material-card, #sozaiba-seo .material-card { border-width: 2px; border-radius: 16px; box-shadow: 0 4px 0 var(--g-card-edge), 0 8px 14px rgba(0, 0, 0, 0.3); }
    #screen-gallery .material-card.premium-coin, #sozaiba-seo .material-card.premium-coin { outline-width: 2px; outline-offset: -5px; box-shadow: 0 4px 0 #6b3300, 0 8px 14px rgba(0, 0, 0, 0.3); }
    #screen-gallery .material-thumbnail, #sozaiba-seo .material-thumbnail { border-bottom-width: 2px; }
    #screen-gallery .material-card .material-info, #sozaiba-seo .material-card .material-info { padding: 10px 10px 12px; }
    #screen-gallery .material-card .material-title, #sozaiba-seo .material-card .material-title { font-size: 14px; }
    #screen-gallery .costume-badge, #sozaiba-seo .costume-badge { left: 6px; bottom: 6px; padding: 3px 8px 2px; font-size: 0.72rem; }
    #screen-gallery .coin-price-row, #sozaiba-seo .coin-price-row { padding: 2px 10px 2px 3px; gap: 4px; }
    #screen-gallery .coin-icon-large, #sozaiba-seo .coin-icon-large { width: 26px; height: 26px; }
    body.fullscreen-body #screen-gallery .coin-price-text, #sozaiba-seo .coin-price-text { font-size: 18px; }
    #screen-gallery .shop-key-img, #sozaiba-seo .shop-key-img { width: 42px; }
    #screen-gallery .thumbnail-play-btn, #sozaiba-seo .thumbnail-play-btn { width: 40px; height: 40px; }
    #screen-gallery .thumbnail-audio-icon, #sozaiba-seo .thumbnail-audio-icon { width: 46px; height: 46px; }
    #screen-gallery .load-more-btn, #sozaiba-seo .load-more-btn { padding: 11px 26px 9px; font-size: 16px; }
    #screen-gallery .selection-button { width: 130px; height: 62px; }
    body.fullscreen-body #screen-gallery .selection-button span { font-size: 21px; }
    body.fullscreen-body #screen-gallery .selection-button span ruby rt { font-size: 9px; }
}

/* ====================================== */
/* SEO ページ（カテゴリのページ・素材の個別ページ）にも同じ「ゲームのボタン」の筋を広げる（2026-11-11） */
/* ====================================== */
/*
 * 素材のカード・コインの札・金の鍵・音のプレーヤー・カテゴリーの札・もっと見るは、上の Screen 3 の節の指定がそのままかかる
 * （各指定に #sozaiba-seo を並べてある）。ここはトップに無い部分だけ
 * - 色はトップと同じ --g-*（画像の素材はうすめの青、音の素材は紫。_includes/header.php の data-media で切り替え）
 * - 見出しは「人気の画像素材 28件」と同じ紺の板＋金のふちの札、説明欄はカードと同じ太いふち＋下の厚みの白い板
 * - _includes/header.php の <style> の古い指定（黄色の見出し・オレンジのボタンなど）は、ここで上書きする
 */

/* もっと見るで隠したカード（Screen 3 の節の display: flex より強く） */
#sozaiba-seo .material-card.hidden {
    display: none;
}

/* 素材の名前は個別ページへのリンク（コインの素材のカードは、押すと交換の窓が開くだけだった） */
#sozaiba-seo .material-detail-link {
    color: inherit;
    text-decoration: none;
}

#sozaiba-seo .material-detail-link:hover,
#sozaiba-seo .material-detail-link:focus-visible {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* コインの札はカードの幅を超えない。入らないときは「コインで交換」が下の行へ回る（768px 以下は最初から2段。下のメディアクエリ） */
#sozaiba-seo .coin-price-row {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    box-sizing: border-box;
}

#sozaiba-seo .coin-price-label {
    text-align: center;
}

/* キャラクター・アイテムの絵は切らずに全部見せる（トップと同じ） */
#sozaiba-seo .material-card[data-category="sprites"] .material-thumbnail img,
#sozaiba-seo .material-card[data-category="items"] .material-thumbnail img {
    object-fit: contain;
}

/* --- パンくず --- */
#sozaiba-seo .breadcrumb {
    display: inline-block;
    margin: 0 0 6px;
    padding: 7px 16px 6px;
    border: 2px solid var(--g-edge);
    border-radius: 999px;
    background: var(--g-chip-face);
    box-shadow: 0 3px 0 var(--g-edge), 0 5px 10px rgba(0, 0, 0, 0.25);
    color: var(--g-ink);
    -webkit-text-fill-color: var(--g-ink);
    text-shadow: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

#sozaiba-seo .breadcrumb a {
    color: var(--g-tag-ink);
    -webkit-text-fill-color: var(--g-tag-ink);
    text-shadow: none;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- カテゴリーの札（トップと同じ札。並びは中央） --- */
#sozaiba-seo .category-nav {
    margin: 14px 0 6px;
    padding: 6px 0;
}

#sozaiba-seo .category-pill {
    text-decoration: none;
}

/* --- ページの見出し（h1）: 紺の板＋金のふちの札 --- */
#sozaiba-seo .category-header {
    padding: 16px 10px 8px;
    margin-bottom: 12px;
}

#sozaiba-seo .category-header h1 {
    transform: none;
    padding: 12px 28px 9px;
    border: 3px solid #f6c445;
    border-radius: 20px;
    background: var(--g-plate-face);
    box-shadow:
        0 5px 0 var(--g-plate-shadow),
        0 10px 18px rgba(0, 0, 0, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.25);
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 26px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #ffe36b;
    -webkit-text-fill-color: #ffe36b;
    text-shadow: 0 2px 0 #000, 0 0 10px rgba(255, 210, 80, 0.5);
}

#sozaiba-seo .category-header h1::before,
#sozaiba-seo .category-header h1::after {
    content: none;
}

/* 札・見出しの字（Dela Gothic One）に付けたルビは、読みやすい丸ゴシックに */
#sozaiba-seo .category-header h1 rt,
#sozaiba-seo .seo-heading rt,
#sozaiba-seo .material-detail-title rt,
#sozaiba-seo .material-info-section h2 rt,
#sozaiba-seo .material-howto-section h2 rt,
#sozaiba-seo .related-materials-section h2 rt,
#sozaiba-seo .seo-action-btn rt,
#sozaiba-seo .btn-spa rt {
    font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
}

#sozaiba-seo .category-header h1 rt,
#sozaiba-seo .seo-heading rt,
#sozaiba-seo .related-materials-section h2 rt {
    -webkit-text-fill-color: #fff;
    text-shadow: 0 1px 0 #000;
}

/* 見出しの下の1行（コインなし・鍵・封印の説明） */
#sozaiba-seo .category-lead {
    margin-top: 18px;
    padding: 10px 18px;
    border: 2px solid var(--g-edge);
    border-radius: 16px;
    background: var(--g-chip-face);
    box-shadow: 0 3px 0 var(--g-edge), 0 6px 12px rgba(0, 0, 0, 0.25);
    color: var(--g-ink);
}

/* --- 節の見出し（h2）: 「人気の画像素材 28件」と同じ札 --- */
#sozaiba-seo .seo-heading,
#sozaiba-seo .related-materials-section h2 {
    display: inline-block;
    margin: 0 0 20px;
    padding: 8px 22px 6px;
    border: 3px solid #f6c445;
    border-radius: 18px;
    background: var(--g-plate-face);
    box-shadow:
        0 4px 0 var(--g-plate-shadow),
        0 8px 16px rgba(0, 0, 0, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.25);
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 21px;
    line-height: 1.45;
    letter-spacing: 0.03em;
    color: #ffe36b;
    -webkit-text-fill-color: #ffe36b;
    text-shadow: 0 2px 0 #000, 0 0 10px rgba(255, 210, 80, 0.5);
}

#sozaiba-seo .seo-grid-section {
    margin-bottom: 40px;
}

/* --- 白い板（説明欄・よくある質問・使い方）: カードと同じ太いふち＋下の厚み --- */
#sozaiba-seo .seo-panel,
#sozaiba-seo .spa-link {
    border: 3px solid var(--g-card-edge);
    border-radius: 20px;
    background: #fff;
    box-shadow:
        0 6px 0 var(--g-card-edge),
        0 12px 22px rgba(0, 0, 0, 0.3);
    color: #2d3436;
}

/* 折りたたみ（使い方・特徴・ライセンス） */
#sozaiba-seo .seo-details {
    margin: 30px 0 28px;
    padding: 0;
}

#sozaiba-seo .seo-details-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px 14px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    color: var(--g-card-edge);
    font-size: 1.15em;
    font-weight: 800;
}

#sozaiba-seo .seo-details-summary::-webkit-details-marker {
    display: none;
}

#sozaiba-seo .seo-details-icon {
    font-size: 1.3em;
}

#sozaiba-seo .seo-details-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: 2px solid #6b3300;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff1a0 0%, #ffd23f 42%, #ffa000 100%);
    box-shadow: 0 3px 0 #6b3300;
    color: #5a2a00;
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

#sozaiba-seo .seo-details[open] .seo-details-arrow {
    transform: rotate(180deg);
}

#sozaiba-seo .seo-details-body {
    margin: 0 22px 22px;
    padding-top: 18px;
    border-top: 2px dashed var(--g-dash);
}

#sozaiba-seo .seo-kid-box {
    margin-bottom: 18px;
    padding: 20px 22px;
    border: 2px solid var(--g-tag-line);
    border-radius: 16px;
    background: var(--g-tag-bg);
}

#sozaiba-seo .seo-kid-box-title {
    margin: 0 0 12px;
    color: var(--g-card-edge);
    font-size: 1.15em;
    font-weight: 800;
}

#sozaiba-seo .seo-kid-box-text {
    margin: 0;
    color: #2d3436;
    font-size: 1.02em;
    line-height: 1.8;
}

#sozaiba-seo .seo-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

#sozaiba-seo .seo-feature {
    padding: 18px 16px 16px;
    border: 2px solid;
    border-radius: 16px;
    text-align: center;
}

#sozaiba-seo .seo-feature--blue { border-color: #b9d4f6; background: linear-gradient(180deg, #ffffff 0%, #e6f1ff 100%); color: #1a4a9a; }
#sozaiba-seo .seo-feature--purple { border-color: #c9c0f5; background: linear-gradient(180deg, #ffffff 0%, #ece8ff 100%); color: #3d2c8c; }
#sozaiba-seo .seo-feature--green { border-color: #9fdcb2; background: linear-gradient(180deg, #ffffff 0%, #e3f8ea 100%); color: #1b7f3b; }

#sozaiba-seo .seo-feature-icon {
    margin-bottom: 6px;
    font-size: 2.4em;
}

#sozaiba-seo .seo-feature-title {
    display: block;
    margin-bottom: 4px;
    font-size: 1.1em;
    font-weight: 800;
}

#sozaiba-seo .seo-feature-text {
    color: #555;
    font-size: 0.9em;
}

/* 使い方（Scratch へのインポートの手順） */
#sozaiba-seo .seo-howto {
    margin: 0 0 40px;
    padding: 26px 30px;
}

#sozaiba-seo .seo-howto-lead {
    margin: 0 0 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--g-tag-bg);
    color: var(--g-tag-ink);
    font-weight: 700;
}

#sozaiba-seo .seo-howto-step {
    margin: 22px 0 8px;
    color: var(--g-card-edge);
    font-size: 1.2em;
    font-weight: 800;
}

#sozaiba-seo .seo-list {
    margin: 0;
    padding-left: 1.5em;
    line-height: 1.9;
}

/* よくある質問 */
#sozaiba-seo .seo-faq {
    margin: 40px 0;
}

#sozaiba-seo .seo-faq-item {
    margin-bottom: 18px;
    padding: 18px 22px;
}

#sozaiba-seo .seo-faq-q {
    margin: 0 0 8px;
    color: var(--g-card-edge);
    font-size: 1.12em;
    font-weight: 800;
}

#sozaiba-seo .seo-faq-a {
    margin: 0;
    color: #555;
    line-height: 1.8;
}

#sozaiba-seo .seo-link {
    color: var(--g-tag-ink);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#sozaiba-seo .seo-link--strong {
    font-weight: 800;
}

/* 素材検索ページへの案内 */
#sozaiba-seo .spa-link {
    margin: 40px 0;
    padding: 28px 20px 30px;
}

#sozaiba-seo .seo-spa-title {
    margin: 0 0 8px;
    color: var(--g-card-edge);
    font-size: 1.35em;
    font-weight: 800;
}

#sozaiba-seo .seo-spa-text {
    margin: 0 0 18px;
    color: #555;
}

#sozaiba-seo .btn-spa {
    display: inline-block;
    padding: 12px 30px 10px;
    border: 3px solid var(--g-edge);
    border-radius: 999px;
    background: var(--g-pill-face);
    box-shadow:
        0 5px 0 var(--g-edge),
        0 9px 16px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 18px;
    letter-spacing: 0.03em;
    text-decoration: none;
    text-shadow: 0 2px 0 var(--g-edge);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

#sozaiba-seo .btn-spa:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow:
        0 7px 0 var(--g-edge),
        0 12px 18px rgba(0, 0, 0, 0.32),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

#sozaiba-seo .btn-spa:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--g-edge), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

/* ====== 素材の個別ページ ====== */
#sozaiba-seo .material-detail-article {
    margin: 24px 0 40px;
    padding: 34px 40px;
    border: 3px solid var(--g-card-edge);
    border-radius: 24px;
    background: #fff;
    box-shadow:
        0 7px 0 var(--g-card-edge),
        0 14px 26px rgba(0, 0, 0, 0.35);
}

#sozaiba-seo .material-detail-header {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px dashed var(--g-dash);
}

#sozaiba-seo .material-detail-title {
    margin: 6px 0 12px;
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 28px;
    line-height: 1.55;
    letter-spacing: 0.02em;
    color: var(--g-card-edge);
}

#sozaiba-seo .material-detail-description {
    margin-top: 10px;
    color: #444;
    font-size: 1.1em;
}

/* 絵の台（カードと同じ明るい舞台）。右の列（素材情報）の高さまで伸ばさない */
#sozaiba-seo .material-preview-area {
    align-self: start;
    padding: 24px;
    border: 3px solid var(--g-card-edge);
    border-radius: 20px;
    background:
        radial-gradient(ellipse 36% 6% at 50% 94%, var(--g-floor) 0%, transparent 100%),
        var(--g-stage);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.06);
}

#sozaiba-seo .motion-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

#sozaiba-seo .motion-tab {
    padding: 6px 14px 5px;
    border: 2px solid var(--g-edge);
    border-radius: 999px;
    background: var(--g-chip-face);
    box-shadow: 0 3px 0 var(--g-edge);
    color: var(--g-ink);
    font-family: inherit;
    font-size: 0.9em;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#sozaiba-seo .motion-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--g-edge);
}

#sozaiba-seo .motion-tab.active {
    border-color: #6b3300;
    background: linear-gradient(180deg, #fff6b8 0%, #ffd84a 45%, #ffa000 100%);
    box-shadow: 0 3px 0 #6b3300, 0 0 0 3px rgba(255, 236, 140, 0.55);
    color: #4a2200;
}

#sozaiba-seo .costume-thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

#sozaiba-seo .costume-thumb {
    width: 80px;
    height: 60px;
    box-sizing: border-box;
    padding: 2px;
    border: 2px solid var(--g-tag-line);
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

#sozaiba-seo .costume-thumb:hover {
    transform: translateY(-2px);
    border-color: var(--g-edge);
}

#sozaiba-seo .costume-thumb.is-selected {
    border-color: #6b3300;
    box-shadow: 0 0 0 3px #ffc83a;
}

#sozaiba-seo .seo-preview-caption {
    margin: 12px 0 0;
    color: var(--g-ink);
    font-size: 0.9em;
    font-weight: 700;
}

/* 音の素材: 夜空の台＋明るい音符＋金色の再生ボタン（一覧の音のカードと同じ） */
#sozaiba-seo .seo-audio-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    aspect-ratio: 4 / 3;
    padding: 20px;
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 30%, rgba(140, 120, 255, 0.45) 0%, rgba(140, 120, 255, 0) 55%),
        linear-gradient(180deg, #3d2c8c 0%, #25185e 60%, #170e40 100%);
}

#sozaiba-seo .seo-audio-stage-icon {
    width: 96px;
    height: 96px;
    margin-bottom: 18px;
    font-size: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23fff3b0'%3E%3Cpath d='M23 14L54 7v10l-31 7z'/%3E%3Crect x='22' y='14' width='5.5' height='35' rx='1'/%3E%3Crect x='49' y='8' width='5.5' height='35' rx='1'/%3E%3Cellipse cx='17' cy='49' rx='10' ry='7.5' transform='rotate(-20 17 49)'/%3E%3Cellipse cx='44' cy='43' rx='10' ry='7.5' transform='rotate(-20 44 43)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    filter: drop-shadow(0 0 10px rgba(255, 214, 90, 0.9)) drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45));
}

/* プレーヤーの板は夜空に溶けるうす暗い板（白い板のままだと白い字が読めない） */
#sozaiba-seo .seo-audio-stage .custom-audio-player {
    margin-top: 0;
    background: rgba(18, 10, 51, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

#sozaiba-seo .seo-audio-stage .time-separator {
    color: rgba(255, 255, 255, 0.6);
}

#sozaiba-seo .seo-audio-stage .play-pause-btn {
    border: 3px solid #6b3300;
    background: linear-gradient(180deg, #fff1a0 0%, #ffd23f 42%, #ffa000 100%);
    box-shadow: 0 3px 0 #6b3300, inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

#sozaiba-seo .seo-audio-stage .play-pause-btn:hover {
    box-shadow: 0 4px 0 #6b3300, 0 0 12px rgba(255, 214, 74, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

#sozaiba-seo .seo-audio-stage .play-icon::before {
    border-color: transparent transparent transparent #5a2a00;
}

#sozaiba-seo .seo-audio-stage .play-icon.pause::before,
#sozaiba-seo .seo-audio-stage .play-icon.pause::after {
    background: #5a2a00;
}

#sozaiba-seo .seo-audio-stage .time-display {
    color: #fff;
    text-shadow: 0 1px 0 #000;
}

#sozaiba-seo .seo-audio-stage .progress-bar-container {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

#sozaiba-seo .seo-audio-stage .progress-bar {
    background: linear-gradient(90deg, #ffe36b 0%, #ffa000 100%);
}

#sozaiba-seo .seo-audio-stage .volume-icon {
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5));
}

#sozaiba-seo .seo-audio-stage .volume-slider {
    accent-color: #ffc83a;
}

#sozaiba-seo .seo-audio-stage .loop-toggle-btn {
    border: 2px solid #120a33;
    background: linear-gradient(180deg, #ffffff 0%, #ece8ff 100%);
    box-shadow: 0 3px 0 #120a33;
    color: #261868;
    font-weight: 800;
}

#sozaiba-seo .seo-audio-stage .loop-toggle-btn.active {
    border-color: #6b3300;
    background: linear-gradient(180deg, #fff6b8 0%, #ffd84a 45%, #ffa000 100%);
    box-shadow: 0 3px 0 #6b3300;
    color: #4a2200;
}

/* 素材情報 */
#sozaiba-seo .material-info-section h2 {
    display: inline-block;
    margin: 0 0 14px;
    padding: 6px 18px 4px;
    border: 3px solid #f6c445;
    border-radius: 14px;
    background: var(--g-plate-face);
    box-shadow: 0 4px 0 var(--g-plate-shadow), inset 0 2px 0 rgba(255, 255, 255, 0.25);
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #ffe36b;
    -webkit-text-fill-color: #ffe36b;
    text-shadow: 0 2px 0 #000;
}

#sozaiba-seo .material-info-section h2 rt {
    -webkit-text-fill-color: #fff;
    text-shadow: 0 1px 0 #000;
}

#sozaiba-seo .material-info-dl dt {
    color: var(--g-card-edge);
    font-weight: 800;
}

#sozaiba-seo .material-info-dl dd {
    margin: 0 0 12px 0;
    padding: 4px 0 10px 14px;
    border-bottom: 2px dashed var(--g-dash);
}

#sozaiba-seo .seo-terms-link {
    margin: 10px 0 0;
}

#sozaiba-seo .material-ai-notice {
    margin-top: 24px;
    padding: 16px 20px;
    border: 2px solid var(--g-tag-line);
    border-radius: 16px;
    background: var(--g-tag-bg);
}

#sozaiba-seo .material-ai-notice p {
    margin: 0;
    color: #333;
    line-height: 1.8;
}

#sozaiba-seo .material-ai-notice strong {
    color: var(--g-card-edge);
    font-size: 1.08em;
}

#sozaiba-seo .material-tags-section h3 {
    margin: 0 0 10px;
    color: var(--g-card-edge);
    font-size: 1.1em;
    font-weight: 800;
}

#sozaiba-seo .material-tag-item {
    padding: 4px 12px;
    border: 1.5px solid var(--g-tag-line);
    border-radius: 999px;
    background: var(--g-tag-bg);
    color: var(--g-tag-ink);
    font-size: 0.9em;
    font-weight: 700;
}

/* 交換・ダウンロードのボタン: 一覧の「もっと見る」と同じ立体のボタン */
#sozaiba-seo .material-download-section {
    margin-top: 30px;
}

#sozaiba-seo .seo-action-btn {
    display: block;
    width: 100%;
    padding: 14px 24px 12px;
    border: 3px solid;
    border-radius: 999px;
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 20px;
    letter-spacing: 0.04em;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

#sozaiba-seo .seo-action-btn--coin {
    border-color: #6b3300;
    background: linear-gradient(180deg, #fff6b8 0%, #ffd84a 40%, #ffb300 75%, #ff9500 100%);
    box-shadow:
        0 6px 0 #6b3300,
        0 12px 20px rgba(0, 0, 0, 0.3),
        inset 0 3px 0 rgba(255, 255, 255, 0.75);
    color: #4a2200;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

#sozaiba-seo .seo-action-btn--download {
    border-color: #0f5a2a;
    background: linear-gradient(180deg, #c8f7d4 0%, #5bd884 40%, #25ad56 75%, #178a41 100%);
    box-shadow:
        0 6px 0 #0f5a2a,
        0 12px 20px rgba(0, 0, 0, 0.3),
        inset 0 3px 0 rgba(255, 255, 255, 0.6);
    color: #fff;
    text-shadow: 0 2px 0 #0f5a2a;
}

#sozaiba-seo .seo-action-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.05);
}

#sozaiba-seo .seo-action-btn--coin:hover {
    box-shadow: 0 9px 0 #6b3300, 0 16px 24px rgba(0, 0, 0, 0.32), inset 0 3px 0 rgba(255, 255, 255, 0.75);
}

#sozaiba-seo .seo-action-btn--download:hover {
    box-shadow: 0 9px 0 #0f5a2a, 0 16px 24px rgba(0, 0, 0, 0.32), inset 0 3px 0 rgba(255, 255, 255, 0.6);
}

#sozaiba-seo .seo-action-btn--coin:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #6b3300, inset 0 3px 0 rgba(255, 255, 255, 0.75);
}

#sozaiba-seo .seo-action-btn--download:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #0f5a2a, inset 0 3px 0 rgba(255, 255, 255, 0.6);
}

#sozaiba-seo .seo-action-btn:focus-visible {
    outline: 3px solid var(--g-edge);
    outline-offset: 3px;
}

#sozaiba-seo .seo-action-note {
    margin-top: 14px;
    color: #555;
    font-size: 0.9em;
    text-align: center;
}

/* Scratch での使い方（個別ページ） */
#sozaiba-seo .material-howto-section {
    margin-top: 34px;
    padding: 24px 30px;
    border: 2px solid var(--g-tag-line);
    border-radius: 20px;
    background: var(--g-tag-bg);
}

#sozaiba-seo .material-howto-section h2 {
    margin: 0 0 14px;
    font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 22px;
    color: var(--g-card-edge);
}

#sozaiba-seo .seo-howto-tip {
    margin-top: 18px;
    padding: 14px 16px;
    border: 2px solid var(--g-tag-line);
    border-left: 6px solid var(--g-edge);
    border-radius: 12px;
    background: #fff;
}

/* 関連する素材（木目の上。一覧と同じカード） */
#sozaiba-seo .related-materials-section {
    margin: 40px 0;
    padding: 0;
    background: transparent;
}

#sozaiba-seo .related-materials-grid {
    gap: 18px;
}

#sozaiba-seo .seo-related-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

#sozaiba-seo .seo-related-card-inner {
    overflow: hidden;
    border: 3px solid var(--g-card-edge);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 0 var(--g-card-edge), 0 10px 18px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#sozaiba-seo .seo-related-card:hover .seo-related-card-inner,
#sozaiba-seo .seo-related-card:focus-visible .seo-related-card-inner {
    transform: translateY(-4px);
    box-shadow: 0 9px 0 var(--g-card-edge), 0 16px 24px rgba(0, 0, 0, 0.35);
}

#sozaiba-seo .seo-related-thumb {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-bottom: 3px solid var(--g-card-edge);
    background:
        radial-gradient(ellipse 34% 7% at 50% 93%, var(--g-floor) 0%, transparent 100%),
        var(--g-stage);
}

#sozaiba-seo .seo-related-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#sozaiba-seo[data-media="image"] .seo-related-card[href*="/backgrounds/"] .seo-related-thumb img {
    object-fit: cover;
}

#sozaiba-seo .seo-related-audio {
    width: 100%;
    height: 100%;
    font-size: 0;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23fff3b0'%3E%3Cpath d='M23 14L54 7v10l-31 7z'/%3E%3Crect x='22' y='14' width='5.5' height='35' rx='1'/%3E%3Crect x='49' y='8' width='5.5' height='35' rx='1'/%3E%3Cellipse cx='17' cy='49' rx='10' ry='7.5' transform='rotate(-20 17 49)'/%3E%3Cellipse cx='44' cy='43' rx='10' ry='7.5' transform='rotate(-20 44 43)'/%3E%3C/g%3E%3C/svg%3E") center / 44% no-repeat,
        radial-gradient(circle at 50% 30%, rgba(140, 120, 255, 0.45) 0%, rgba(140, 120, 255, 0) 55%),
        linear-gradient(180deg, #3d2c8c 0%, #25185e 60%, #170e40 100%);
}

#sozaiba-seo .seo-related-name p {
    margin: 0;
    padding: 10px 12px 12px;
    color: var(--g-card-edge);
    font-size: 0.95em;
    font-weight: 800;
}

#sozaiba-seo .seo-related-note {
    display: table;
    margin: 22px auto 0;
    padding: 6px 16px 5px;
    border: 2px solid var(--g-edge);
    border-radius: 999px;
    background: var(--g-chip-face);
    box-shadow: 0 3px 0 var(--g-edge);
    color: var(--g-ink);
    font-size: 0.9em;
    font-weight: 700;
}

/* カテゴリのページへ戻る */
#sozaiba-seo .seo-back {
    margin: 40px 0;
    text-align: center;
}

#sozaiba-seo .seo-back-link {
    display: inline-block;
    padding: 9px 22px 7px;
    border: 2px solid var(--g-edge);
    border-radius: 999px;
    background: var(--g-chip-face);
    box-shadow: 0 3px 0 var(--g-edge), 0 5px 10px rgba(0, 0, 0, 0.25);
    color: var(--g-ink);
    font-size: 1.05em;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#sozaiba-seo .seo-back-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--g-edge), 0 7px 12px rgba(0, 0, 0, 0.28);
}

@media (prefers-reduced-motion: reduce) {
    #sozaiba-seo .seo-details-arrow,
    #sozaiba-seo .seo-action-btn,
    #sozaiba-seo .btn-spa,
    #sozaiba-seo .seo-related-card-inner { transition: none; }
}

/* タブレット（768px 以下） */
@media (max-width: 768px) {
    #sozaiba-seo .category-header h1 { padding: 10px 18px 8px; font-size: 21px; }
    #sozaiba-seo .seo-heading,
    #sozaiba-seo .related-materials-section h2 { padding: 7px 18px 5px; font-size: 18px; }
    #sozaiba-seo .material-detail-article { padding: 24px 20px; }
    #sozaiba-seo .material-detail-title { font-size: 23px; }
    #sozaiba-seo .seo-howto,
    #sozaiba-seo .material-howto-section { padding: 20px 18px; }
    /* コインの札: SEO ページのカードは 768px 以下で細い（スマホ2列・タブレット3列で 135〜190px）。札は1行だと 177〜213px あるので、
       「コインで交換」を値段の下の行に回す（トップの一覧は変えない） */
    #sozaiba-seo .coin-price-row { row-gap: 0; padding: 3px 10px 4px; border-radius: 14px; }
    #sozaiba-seo .coin-price-label { flex-basis: 100%; line-height: 1.3; }
}

/* スマホ（480px 以下） */
@media (max-width: 480px) {
    #sozaiba-seo .breadcrumb { font-size: 12px; padding: 6px 12px 5px; }
    #sozaiba-seo .category-header h1 { padding: 8px 12px 6px; border-width: 2px; border-radius: 14px; font-size: 17px; }
    #sozaiba-seo .category-header h1 rt,
    #sozaiba-seo .seo-heading rt { font-size: 8px; }
    #sozaiba-seo .seo-heading,
    #sozaiba-seo .related-materials-section h2 { padding: 6px 14px 4px; border-width: 2px; border-radius: 14px; font-size: 16px; }
    #sozaiba-seo .seo-panel,
    #sozaiba-seo .spa-link { border-width: 2px; border-radius: 16px; box-shadow: 0 4px 0 var(--g-card-edge), 0 8px 14px rgba(0, 0, 0, 0.3); }
    #sozaiba-seo .seo-details-summary { padding: 14px 16px 12px; font-size: 1.02em; }
    #sozaiba-seo .seo-details-body { margin: 0 14px 16px; }
    #sozaiba-seo .material-detail-article { padding: 18px 14px; border-width: 2px; border-radius: 18px; box-shadow: 0 5px 0 var(--g-card-edge), 0 10px 18px rgba(0, 0, 0, 0.3); }
    #sozaiba-seo .material-detail-title { font-size: 19px; }
    #sozaiba-seo .material-preview-area { padding: 14px; }
    #sozaiba-seo .seo-action-btn { font-size: 17px; padding: 12px 16px 10px; }
    #sozaiba-seo .btn-spa { font-size: 15px; padding: 10px 20px 8px; }
}
