/* --- デザインシステム & 変数 --- */
:root {
    --bg-main: #06050c;
    --bg-darker: #030206;
    --card-bg: rgba(16, 12, 28, 0.55);
    --card-border: rgba(255, 255, 255, 0.08);
    
    /* ネオンカラー */
    --color-primary: #ff1a53;      /* ネオンピンク */
    --color-secondary: #00f0ff;    /* ネオンブルー */
    --color-success: #39ff14;      /* ネオングリーン */
    --color-text: #e2dff0;
    --color-text-muted: #8b87a8;
    
    /* プラットフォームカラー */
    --color-myfans: #ff5a5f;
    --color-dlsite: #1a73e8;
    --color-fanza: #e6a100;
    --color-fansly: #4ca3ff; /* Fanslyライトブルー */
}

/* --- 全体リセット ＆ 基本設定 --- */
* {
    margin: 0;
    padding: 0;
    box-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--color-text);
    overflow-x: hidden;
    line-height: 1.6;
}

/* 背景光彩エフェクト */
.bg-glow-1 {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(255, 26, 83, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.bg-glow-2 {
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.06) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* --- グラスマホ・カード共通スタイル --- */
.glass {
    background: rgba(10, 8, 20, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* --- 年齢認証モーダル (Age Gate) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 2, 6, 0.9);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255, 26, 83, 0.2);
    box-shadow: 0 0 40px rgba(255, 26, 83, 0.15);
}

.modal-icon {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(255, 26, 83, 0.5);
}

.futuristic-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-text {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: var(--color-text);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-notice {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* --- ボタン共通スタイル --- */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #d6003c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 26, 83, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* --- ヘッダー --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

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

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    text-decoration: none;
    color: var(--color-text);
    letter-spacing: 1px;
}

.logo-accent {
    color: var(--color-primary);
    text-shadow: 0 0 10px rgba(255, 26, 83, 0.5);
}

/* NSFWトグルスイッチ */
.nsfw-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--card-border);
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    transition: color 0.3s;
}

.toggle-label.active {
    color: var(--color-text);
}

#toggle-label-nsfw.active {
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(255, 26, 83, 0.3);
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2b263d;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- メインコンテナ --- */
.main-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ヒーローセクション */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

/* コントロールパネル */
.control-panel {
    padding: 25px;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 検索ボックス */
.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

#search-input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--color-text);
    font-size: 1rem;
    transition: all 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

/* フィルター */
.filters-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: var(--color-text-muted);
    min-width: 110px;
    font-size: 0.9rem;
}

.filter-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
}

.filter-btn.active {
    background: var(--color-secondary);
    color: #030206;
    font-weight: 600;
    border-color: var(--color-secondary);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.35);
}

/* --- カードグリッド --- */
.results-header {
    margin-bottom: 20px;
}

.results-count {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* コンテンツカード */
.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* サムネイルエリア */
.card-thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 65%; /* 16:9 程度の比率 */
    overflow: hidden;
    background: #141221;
}

.card-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.4s ease;
}

.card:hover .card-thumbnail {
    transform: scale(1.05);
}

/* NSFWぼかしエフェクト */
.nsfw-blur {
    filter: blur(25px) brightness(0.6);
}

.nsfw-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(3, 2, 6, 0.85);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 10;
    letter-spacing: 0.5px;
}

/* ぼかし時の中央R-18警告マーク */
.blur-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    text-align: center;
    color: white;
    width: 80%;
    pointer-events: none;
}

.blur-warning-icon {
    font-size: 2.2rem;
    color: var(--color-primary);
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(255, 26, 83, 0.8);
}

.blur-warning-text {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* カードボディ */
.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* バッジ類 */
.card-badges {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.badge-platform {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* サイトごとのバッジカラー */
.badge-platform.myfans {
    background: rgba(255, 90, 95, 0.15);
    color: var(--color-myfans);
    border: 1px solid rgba(255, 90, 95, 0.3);
}
.badge-platform.dlsite {
    background: rgba(26, 115, 232, 0.15);
    color: var(--color-dlsite);
    border: 1px solid rgba(26, 115, 232, 0.3);
}
.badge-platform.fansly {
    background: rgba(76, 163, 255, 0.15);
    color: var(--color-fansly);
    border: 1px solid rgba(76, 163, 255, 0.3);
}
.badge-platform.fanza {
    background: rgba(230, 161, 0, 0.15);
    color: var(--color-fanza);
    border: 1px solid rgba(230, 161, 0, 0.3);
}

.badge-category {
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-muted);
    padding: 3px 8px;
    border-radius: 4px;
}

/* タイトル & テキスト */
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--color-text);
    /* 2行制限 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    /* 3行制限 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.8em;
    flex-grow: 1;
}

/* カード下部 */
.card-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: auto;
}

.card-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.card-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

/* サイト毎のボタンデザイン */
.card-btn.myfans-btn {
    background: linear-gradient(135deg, var(--color-myfans) 0%, #d33c41 100%);
    color: white;
}
.card-btn.myfans-btn:hover {
    box-shadow: 0 0 15px rgba(255, 90, 95, 0.4);
}

.card-btn.dlsite-btn {
    background: linear-gradient(135deg, var(--color-dlsite) 0%, #105bb5 100%);
    color: white;
}
.card-btn.dlsite-btn:hover {
    box-shadow: 0 0 15px rgba(26, 115, 232, 0.4);
}

.card-btn.fanza-btn {
    background: linear-gradient(135deg, var(--color-fanza) 0%, #c48900 100%);
    color: white;
}
.card-btn.fanza-btn:hover {
    box-shadow: 0 0 15px rgba(230, 161, 0, 0.4);
}

.card-btn.fansly-btn {
    background: linear-gradient(135deg, var(--color-fansly) 0%, #1a75d6 100%);
    color: white;
}
.card-btn.fansly-btn:hover {
    box-shadow: 0 0 15px rgba(76, 163, 255, 0.4);
}

/* --- 結果なし / エラー時 --- */
.no-results-box {
    text-align: center;
    padding: 60px 20px;
    margin: 40px 0;
}

.no-results-icon {
    font-size: 3rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.no-results-box h3 {
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

/* --- フッター --- */
.main-footer {
    border-top: 1px solid var(--card-border);
    padding: 40px 0;
    background: var(--bg-darker);
    margin-top: 80px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-container p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.footer-disclaimer {
    font-size: 0.75rem !important;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
}

/* --- レスポンス対応 (スマートフォン/タブレット) --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .control-panel {
        padding: 15px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cards-grid {
        gap: 20px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
}
