*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #fff;
    color: #333;
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
}

.hidden { display: none !important; }
.inner { padding: 0 16px; }

/* === モーダル共通 === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 560px;
    width: 100%;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

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

.terms-modal {
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.terms-modal h2 {
    font-size: 22px;
    margin-bottom: 16px;
}

.terms-content {
    overflow-y: auto;
    flex: 1;
    font-size: 13px;
    line-height: 1.7;
}

.terms-content h3 {
    font-size: 15px;
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 6px;
}

.terms-content h3:first-child {
    margin-top: 0;
}

.terms-content ul {
    padding-left: 20px;
    margin-bottom: 8px;
}

.terms-content li {
    margin-bottom: 4px;
}

.modal-ok-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #e91e63;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
}

.modal-ok-btn:hover {
    opacity: 0.9;
}

.footer-links {
    margin: 8px 0;
}

.footer-links a {
    color: #e91e63;
    text-decoration: none;
    font-size: 13px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* 広告 */
.ad-top, .ad-mid, .ad-bottom { text-align: center; margin: 8px auto; max-width: 600px; }

/* ヘッダー */
.header {
    background: linear-gradient(135deg, #ff3f3f, #ff6b6b);
    color: #fff;
    text-align: center;
    padding: 20px 16px;
}
.logo { font-size: 24px; font-weight: 900; }
.tagline { font-size: 13px; opacity: 0.9; margin-top: 4px; }

/* ガイドセクション */
.guide-section { background: #fff8f0; padding: 20px 0; }
.section-heading {
    font-size: 16px; font-weight: 700; margin-bottom: 14px;
    padding-bottom: 8px; border-bottom: 2px solid #ff3f3f;
}
.guide-steps { display: flex; flex-direction: column; gap: 12px; }
.guide-step {
    display: flex; align-items: flex-start; gap: 12px;
    background: #fff; border-radius: 10px; padding: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.step-number {
    width: 30px; height: 30px; background: #ff3f3f; color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.step-text strong { font-size: 14px; }
.step-text p { font-size: 12px; color: #888; margin-top: 2px; }

/* ランキングセクション */
.ranking-section { padding: 20px 0; }
.ranking-category { margin-bottom: 20px; }
.category-title {
    font-size: 15px; font-weight: 700; margin-bottom: 10px;
    padding: 6px 12px; background: #fff0f0; border-left: 4px solid #ff3f3f; border-radius: 0 6px 6px 0;
}
.ranking-card {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid #eee; border-radius: 10px;
    padding: 12px; margin-bottom: 8px; text-decoration: none; color: #333;
    transition: all 0.2s;
}
.ranking-card:hover { border-color: #ff3f3f; box-shadow: 0 2px 10px rgba(255,63,63,0.1); }
.rank-badge {
    background: #ff3f3f; color: #fff; font-size: 11px; font-weight: 700;
    padding: 4px 8px; border-radius: 6px; flex-shrink: 0; text-align: center; min-width: 36px;
}
.rank-badge.hot { background: #ff6b00; }
.rank-1 { border-left: 4px solid #ffd700; }
.rank-2 { border-left: 4px solid #c0c0c0; }
.rank-3 { border-left: 4px solid #cd7f32; }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 14px; font-weight: 700; }
.rank-desc { font-size: 11px; color: #888; margin-top: 2px; }
.rank-tags { display: flex; gap: 4px; margin-top: 4px; }
.rank-tags span {
    font-size: 10px; background: #f0f0f0; color: #666;
    padding: 2px 6px; border-radius: 4px;
}
.rank-cta {
    font-size: 12px; font-weight: 700; color: #ff3f3f;
    white-space: nowrap; flex-shrink: 0;
}

/* ジャンルグリッド */
.genre-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.genre-card {
    background: #fff; border: 1px solid #eee; border-radius: 8px;
    padding: 10px 6px; text-align: center; font-size: 12px; font-weight: 500;
    text-decoration: none; color: #333; transition: all 0.2s;
}
.genre-card:hover { border-color: #ff3f3f; background: #fff5f5; }

/* アフィリエイト */
.affiliate-section { background: #f8f8f8; padding: 20px 0; }
.affiliate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.affiliate-card {
    background: #fff; border-radius: 10px; padding: 14px; text-align: center;
    text-decoration: none; color: #333; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}
.affiliate-card:hover { transform: translateY(-2px); }
.aff-icon { font-size: 32px; margin-bottom: 6px; }
.aff-name { font-size: 13px; font-weight: 700; }
.aff-desc { font-size: 11px; color: #888; margin-top: 2px; }
.aff-btn {
    display: inline-block; margin-top: 8px; background: #ff3f3f; color: #fff;
    padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 700;
}

/* 掲示板セクション */
.bbs-section { padding: 20px 0; }
.board-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.board-card {
    background: #fff; border: 2px solid #eee; border-radius: 12px;
    padding: 16px; text-align: center; cursor: pointer; transition: all 0.2s;
}
.board-card:hover { border-color: #ff3f3f; }
.board-icon { font-size: 28px; margin-bottom: 4px; }
.board-name { font-size: 13px; font-weight: 700; }
.board-count { font-size: 11px; color: #999; }
.sub-heading { font-size: 15px; font-weight: 700; margin: 16px 0 10px; }

/* 投稿一覧 */
.posts-list { display: flex; flex-direction: column; gap: 8px; }
.post-card {
    background: #fff; border: 1px solid #eee; border-radius: 10px;
    padding: 14px; position: relative;
}
.post-top { display: flex; align-items: center; gap: 10px; }
.post-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.post-avatar.male { background: #e3f2fd; }
.post-avatar.female { background: #fce4ec; }
.post-avatar.other { background: #f3e5f5; }
.post-info { flex: 1; }
.post-name { font-size: 14px; font-weight: 700; }
.post-meta { font-size: 11px; color: #999; }
.post-badge {
    font-size: 10px; padding: 2px 8px; border-radius: 10px;
    font-weight: 700; color: #fff; background: #ff3f3f;
}
.post-tags { margin-top: 6px; }
.tag { font-size: 11px; background: #f5f5f5; padding: 2px 8px; border-radius: 10px; color: #666; }
.post-message { margin-top: 8px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.post-contact {
    margin-top: 8px; padding: 8px 12px; background: #fff8f0;
    border: 1px solid #ffe0b2; border-radius: 8px; font-size: 13px;
    display: flex; align-items: center; gap: 6px;
}
.post-contact strong { color: #ff3f3f; }
.copy-btn {
    margin-left: auto; padding: 3px 10px; border: 1px solid #ff3f3f;
    background: none; color: #ff3f3f; border-radius: 4px; cursor: pointer;
    font-size: 11px; font-weight: 500;
}
.copy-btn:hover { background: #ff3f3f; color: #fff; }
.post-time { font-size: 10px; color: #ccc; margin-top: 6px; text-align: right; }
.post-delete {
    position: absolute; top: 8px; right: 8px; background: none; border: none;
    color: #ddd; cursor: pointer; font-size: 16px;
}
.no-posts { text-align: center; padding: 30px; color: #999; font-size: 14px; }

/* フォーム */
.post-form {
    background: #f9f9f9; border-radius: 10px; padding: 16px; margin-bottom: 14px;
}
.post-form h4 { font-size: 14px; margin-bottom: 10px; }
.form-row { display: flex; gap: 8px; margin-bottom: 8px; }
.form-row input, .form-row select { flex: 1; }
input, select, textarea {
    padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 13px; font-family: inherit; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #ff3f3f; }
input.full { margin-bottom: 8px; }
textarea { resize: vertical; margin-bottom: 8px; }
.agree-label { font-size: 12px; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.agree-label a { color: #ff3f3f; }
.submit-btn {
    width: 100%; padding: 12px; background: #ff3f3f; color: #fff; border: none;
    border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer;
    font-family: inherit;
}
.submit-btn:hover { opacity: 0.9; }

/* フィルター */
.filter-row { display: flex; gap: 6px; margin-bottom: 10px; }
.filter-row select { flex: 1; font-size: 12px; padding: 6px; }

/* 戻るボタン */
.back-btn {
    background: none; border: 1px solid #ddd; padding: 6px 14px;
    border-radius: 6px; cursor: pointer; font-size: 13px; margin-bottom: 10px;
}
.board-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.board-header h3 { font-size: 16px; }

/* トースト */
.toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: #333; color: #fff; padding: 10px 24px; border-radius: 8px;
    font-size: 13px; z-index: 999;
}

/* フッター */
.footer {
    background: #333; color: #aaa; text-align: center; padding: 16px;
    font-size: 13px;
}
.footer-note { font-size: 10px; margin-top: 6px; opacity: 0.7; line-height: 1.5; }

@media (max-width: 600px) {
    .genre-grid { grid-template-columns: repeat(2, 1fr); }
    .affiliate-grid { grid-template-columns: 1fr; }
}
