:root {
    --bg-main: #09090b;
    --bg-sub: #121215;
    --card-bg: #18181b;
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --text-main: #ffffff;
    --text-sub: #a1a1aa;
    --accent: #8b5cf6;
    --border: #27272a;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-y: scroll;
}

.navbar {
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 0;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand {
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-link { color: var(--text-sub); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: 0.2s; }
.nav-link:hover, .nav-link.active { color: white; }

.nav-discord-btn {
    background: #5865F2;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 99px;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}
.nav-discord-btn:hover { background: #4752c4; transform: translateY(-1px); }

/* --- サイドメニュー用 --- */
.menu-btn {
    font-size: 1.5rem; color: var(--text-main); cursor: pointer;
    margin-left: 10px; transition: color 0.2s;
}
.menu-btn:hover { color: var(--primary); }

.side-menu {
    position: fixed; top: 0; right: -300px; width: 260px; height: 100vh;
    background: var(--card-bg); border-left: 1px solid var(--border);
    z-index: 3000; transition: right 0.3s ease; padding: 25px;
    box-shadow: -5px 0 30px rgba(0,0,0,0.7); overflow-y: auto;
}
.side-menu.open { right: 0; }

.side-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
    z-index: 2999; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.side-menu-overlay.open { opacity: 1; pointer-events: all; }

.close-menu-btn {
    background: none; border: none; color: var(--text-sub);
    font-size: 1.5rem; cursor: pointer; float: right; transition: color 0.2s;
}
.close-menu-btn:hover { color: white; }

.side-menu-content { margin-top: 50px; display: flex; flex-direction: column; gap: 15px; }
.side-menu-content h3 { color: var(--text-sub); font-size: 0.85rem; text-transform: uppercase; margin-bottom: 5px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.side-menu-content a {
    color: white; text-decoration: none; font-size: 1.05rem; font-weight: 600;
    padding: 12px; border-radius: 8px; transition: 0.2s; display: flex; align-items: center; gap: 12px;
}
.side-menu-content a:hover { background: rgba(99, 102, 241, 0.15); color: var(--primary); transform: translateX(5px); }
.side-menu-content a i { width: 20px; text-align: center; }

/* --- その他既存のスタイル --- */
.hero {
    position: relative; padding: 80px 20px; text-align: center; overflow: hidden;
    background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, var(--bg-main) 70%); z-index: 1; 
}
.hero-content h1 { font-size: 3.5rem; font-weight: 900; line-height: 1.1; margin-bottom: 20px; }
.text-gradient { background: linear-gradient(135deg, #818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-content p { color: var(--text-sub); font-size: 1.1rem; margin-bottom: 30px; line-height: 1.6; }
.hero-actions { display: flex; justify-content: center; gap: 15px; }
.btn-hero {
    padding: 12px 30px; border-radius: 99px; text-decoration: none; font-weight: bold; font-size: 1rem;
    display: inline-flex; align-items: center; gap: 8px; transition: 0.3s; border: none; cursor: pointer;
}
.btn-hero.primary { background: white; color: black; }
.btn-hero.primary:hover { background: #e0e7ff; box-shadow: 0 0 20px rgba(255, 255, 255, 0.3); }
.btn-hero.secondary { background: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-hero.secondary:hover { background: rgba(255, 255, 255, 0.2); }

.controls-container {
    max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 20px;
    justify-content: space-between; align-items: center; transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); 
    max-height: 300px; opacity: 1; overflow: visible; padding: 20px; transform: translateY(0);
    position: relative; z-index: 100; 
}
.controls-container.hidden {
    max-height: 0; opacity: 0; overflow: hidden; padding: 0 20px; transform: translateY(-10px); pointer-events: none;
}

.search-box { position: relative; flex: 1; min-width: 300px; }
.search-box i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-sub); }
#search-input {
    width: 100%; background: var(--bg-sub); border: 1px solid var(--border);
    padding: 12px 12px 12px 45px; border-radius: 12px; color: white; font-size: 1rem; outline: none; transition: 0.2s; box-sizing: border-box;
}
#search-input:focus { border-color: var(--primary); background: #000; }

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

.custom-dropdown-wrapper { position: relative; width: 150px; font-size: 0.9rem; }
.tag-filter-wrapper { width: 200px; }
.custom-dropdown-trigger {
    background: var(--bg-sub); border: 1px solid var(--border); border-radius: 12px; padding: 10px 15px;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; color: white; font-weight: 600; transition: 0.2s; user-select: none;
}
.custom-dropdown-trigger:hover { background: #27272a; border-color: #555; }
.custom-dropdown-options {
    position: absolute; top: calc(100% + 8px); left: 0; width: 100%; background: #18181b; 
    border: 1px solid var(--border); border-radius: 12px; padding: 5px; display: none;
    z-index: 200; box-shadow: 0 10px 40px rgba(0,0,0,0.6); max-height: 250px; overflow-y: auto;
}
.custom-dropdown-options.show { display: block; animation: dropFadeIn 0.2s; }
.custom-dropdown-options::-webkit-scrollbar { width: 6px; }
.custom-dropdown-options::-webkit-scrollbar-track { background: transparent; }
.custom-dropdown-options::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }
.custom-option { padding: 10px 15px; cursor: pointer; color: var(--text-sub); transition: 0.2s; border-radius: 8px; font-weight: 500; }
.custom-option:hover { background: #27272a; color: white; }
.custom-option.selected { background: rgba(99, 102, 241, 0.15); color: var(--primary); font-weight: bold; }
.custom-option.selected::after { content: '✓'; float: right; font-weight: bold; }

@keyframes dropFadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

main { max-width: 1200px; margin: 0 auto; padding: 20px; min-height: 500px; position: relative; z-index: 1; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; cursor: pointer; transition: all 0.2s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); border-color: var(--primary); }
.card-img-wrapper { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.card:hover .card-img { transform: scale(1.05); }
.price-tag { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.85); color: #ffd700; padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; border: 1px solid rgba(255,215,0,0.3); z-index: 2; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.tag-pill { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-stats { display: flex; gap: 12px; font-size: 0.8rem; color: var(--text-sub); align-items: center; white-space: nowrap; flex-shrink: 0; }
.likes-count { color: #ff4757; font-weight: bold; display: flex; align-items: center; gap: 4px;}
.card-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 10px 0; line-height: 1.4; color: white; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-author { margin-top: auto; font-size: 0.85rem; color: var(--text-sub); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* --- ページネーション用 --- */
.pagination {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    margin-top: 50px; padding-bottom: 20px; flex-wrap: wrap;
}
.pagination button {
    background: var(--bg-sub); border: 1px solid var(--border); color: var(--text-sub);
    min-width: 40px; height: 40px; border-radius: 8px; font-weight: bold; cursor: pointer;
    transition: 0.2s; display: flex; justify-content: center; align-items: center; padding: 0 10px;
}
.pagination button:hover:not(:disabled) { background: #27272a; color: white; }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 0 15px rgba(99, 102, 241, 0.4); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }
.page-dots { color: var(--text-sub); padding: 0 5px; font-weight: bold; }


.tos-container { max-width: 800px; margin: 40px auto; padding: 40px; background: var(--card-bg); border-radius: 20px; border: 1px solid var(--border); }
.tos-container h2 { text-align: center; margin-bottom: 30px; font-size: 2rem; }
.tos-content section { margin-bottom: 30px; }
.tos-content h3 { color: #fff; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 15px; }
.tos-content p { color: #ccc; line-height: 1.8; }
.tos-action { text-align: center; margin-top: 40px; }
.btn-back { background: var(--border); color: white; border: none; padding: 12px 30px; border-radius: 8px; cursor: pointer; font-weight: bold; }
.btn-back:hover { background: #333; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 4000; display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.2s; }
.modal-overlay.show { opacity: 1; }
.modal-window { width: 90%; max-width: 1000px; max-height: 90vh; background: var(--card-bg); border-radius: 20px; border: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; position: relative; transform: scale(0.95); transition: transform 0.2s; }
.modal-overlay.show .modal-window { transform: scale(1); }
.modal-close { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.5); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; z-index: 10; transition: 0.2s; }
.modal-close:hover { background: rgba(255,255,255,0.2); }
.modal-content { display: flex; height: 100%; overflow: hidden; }
.modal-gallery { flex: 1.5; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
#modal-main-image { max-width: 100%; max-height: 60vh; object-fit: contain; }
.thumbnails { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; max-width: 100%; }
.thumb { width: 60px; height: 40px; object-fit: cover; opacity: 0.5; cursor: pointer; border-radius: 4px; }
.thumb.active { opacity: 1; border: 2px solid var(--primary); }

.modal-info { flex: 1; padding: 40px; overflow-y: auto; background: var(--bg-sub); display: flex; flex-direction: column;}
.modal-header-badges { display: flex; gap: 10px; margin-bottom: 15px; }
.badge { padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; background: #333; }
.type-badge { background: var(--primary); }
#modal-title { font-size: 2rem; margin: 0 0 10px 0; line-height: 1.2; }
.modal-author-block { margin-bottom: 20px; }
.modal-author { color: var(--text-sub); font-size: 1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.modal-date-text { color: #666; font-size: 0.9rem; margin-left: 24px; }

.modal-description-box { background: var(--card-bg); padding: 20px; border-radius: 12px; color: #e4e4e7; line-height: 1.7; margin-bottom: 20px; white-space: pre-wrap; }
.modal-actions { display: flex; gap: 10px; margin-top: auto; }
.btn { flex: 1; padding: 14px; border-radius: 10px; font-weight: bold; text-align: center; text-decoration: none; border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; transition: 0.2s;}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #4f46e5; }
.btn-twitter { background: #000; color: white; border: 1px solid #333; }
.btn-twitter:hover { background: #222; }

@media (max-width: 768px) {
    .modal-content { flex-direction: column; overflow-y: auto; }
    .modal-gallery { height: 300px; flex: none; }
    .controls-container { flex-direction: column; align-items: stretch; }
}

/* --- 🌟 広告 (PR) エリア用スタイル --- */
.ad-container {
    display: flex; gap: 15px; margin: 20px auto;
    max-width: 1200px; padding: 0 20px; overflow-x: auto;
}
.ad-container::-webkit-scrollbar { display: none; }

.ad-card {
    position: relative; background: var(--card-bg); border: 1px solid #3f3f46;
    border-radius: 12px; overflow: hidden; width: 100%; max-width: 300px;
    flex-shrink: 0; display: block; text-decoration: none; transition: 0.2s;
}
.ad-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.ad-badge {
    position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,0.8);
    color: #a1a1aa; font-size: 0.65rem; font-weight: bold; padding: 2px 6px;
    border-radius: 4px; z-index: 10; border: 1px solid #3f3f46;
}
.ad-img { width: 100%; height: 120px; object-fit: cover; border-bottom: 1px solid var(--border); }
.ad-info { padding: 10px; }
.ad-title { color: #fff; font-size: 0.9rem; font-weight: bold; margin: 0 0 5px 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ad-desc { color: var(--text-sub); font-size: 0.75rem; margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 画面が十分に広いPC（1400px以上）の場合は左側に固定する */
@media (min-width: 1400px) {
    .ad-container {
        position: fixed; top: 100px; left: 20px;
        flex-direction: column; width: 220px; margin: 0; padding: 0;
        z-index: 500;
    }
    .ad-card { max-width: 100%; }
    .ad-img { height: 100px; }
}