/* 全体のスタイル */
body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
}

.container {
    width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-width: 1000px;
}

/* レイアウト構造 */
.layout-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    min-height: 400px;
    flex-wrap: nowrap;
}

.sidebar {
    width: 200px;
    flex-shrink: 0;
    flex-grow: 0;
}

.sidebar-left {
    order: 1;
    flex-basis: 200px;
}

.main-content {
    flex: 1 1 auto;
    order: 2;
    min-width: 0;
    padding: 20px 0;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.main-content.has-left-sidebar {
    order: 2;
}

.main-content.has-right-sidebar {
    order: 2;
}

.sidebar-right {
    order: 3;
    flex-basis: 200px;
}

/* サイドバーのスタイル */
.sidebar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

.sidebar h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    text-align: center;
    border-bottom: 2px solid #e6b422;
    padding-bottom: 8px;
}

.pr-label {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

/* アフィリエイトアイテムのスタイル */
.affiliate-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}

.affiliate-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.affiliate-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.affiliate-item h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    height: 3.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.affiliate-btn {
    display: inline-block;
    background: linear-gradient(45deg, #ff9f00, #ff7b00);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(255, 159, 0, 0.3);
}

.affiliate-btn:hover {
    background: linear-gradient(45deg, #ff7b00, #e55a00);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 159, 0, 0.4);
    color: white;
    text-decoration: none;
}

/* レスポンシブ対応 */
@media (max-width: 1250px) {
    .container {
        width: 100%;
        max-width: 1200px;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .layout-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 3 !important;
        position: static;
        margin-top: 20px;
    }
    
    .main-content {
        order: 1 !important;
    }
    
    .sidebar h4 {
        text-align: left;
    }
    
    .affiliate-item {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 15px;
        padding: 15px 0;
    }
    
    .affiliate-item img {
        width: 80px;
        height: 80px;
        object-fit: cover;
        flex-shrink: 0;
        border-radius: 6px;
    }
    
    .affiliate-item h5 {
        height: auto;
        -webkit-line-clamp: 3;
        margin: 0 0 5px 0;
    }
    
    .affiliate-btn {
        margin-top: 5px;
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* タブレット用の調整 */
@media (min-width: 769px) and (max-width: 1100px) {
    .sidebar {
        width: 180px;
    }
    
    .affiliate-item h5 {
        font-size: 13px;
        height: 3.2em;
    }
    
    .affiliate-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* ヘッダー */
header {
    background: #fff;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    position: relative; /* 子要素の絶対配置のため */
}

header h1 {
    margin: 0;
    font-size: 24px;
}

header h1 a {
    text-decoration: none;
    color: #333;
}

/* ナビゲーション */
nav {
    background: #333;
    padding: 0;
}

nav ul {
    margin: 0;
    padding: 10px 0; /* 上下のpaddingを戻す */
    list-style: none;
    display: flex;
    gap: 20px;
    justify-content: center; /* メニュー項目を中央揃え */
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
}

nav ul li a:hover {
    background: #555;
}

/* 現在のページをハイライトするスタイル */
nav ul li a.active {
    background: #e6b422;
    color: #333;
    font-weight: bold;
}

/* アクセスカウンター */
.access-counter {
    position: absolute;
    top: 25px; /* 位置を微調整 */
    right: 20px;
}
.access-counter img {
    vertical-align: middle; /* 画像の縦位置を中央に */
    margin-left: 3px;
}

/* --- ドロップダウンメニュー用のスタイル --- */
nav ul li {
    position: relative; /* ドロップダウンの基準点 */
}
.dropdown-menu {
    display: none; /* 通常は非表示 */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #333;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 180px; /* ドロップダウンの幅 */
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}
.dropdown-menu li a {
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    color: white;
}
.dropdown-menu li a:hover {
    background-color: #555;
}
nav ul li:hover .dropdown-menu {
    display: block; /* ホバー時に表示 */
}
/* ------------------------------------- */

/* メインコンテンツ */
.main-content {
    flex: 1;
    order: 2;
    min-width: 0;
    padding: 20px 0;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.main-content h2 {
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

/* ゲームページ用のスタイル */
.game-article {
    background: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.game-article h3 {
    border-left: 5px solid #333;
    padding-left: 10px;
    margin-top: 0;
}

/* ゲーム記事の見出し (h4) */
.game-article h4 {
    background-color: #333;
    color: #fff;
    padding: 10px 15px;
    margin-top: 40px;
    margin-bottom: 20px;
    border-radius: 3px;
    font-size: 20px;
    letter-spacing: 1px;
}

/* ゲーム記事の小見出し (h6) */
.game-article h6 {
    font-size: 17px;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #e6b422; /* ナビゲーションのハイライトに合わせた色 */
    padding-bottom: 6px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.game-article .article-content p {
    margin-bottom: 1.5em; /* 段落ごとの下余白を追加 */
}

/* ゲーム内目次 */
.game-toc {
    background: #f9f9f9; 
    padding: 15px 20px; 
    border-radius:5px; 
    margin-bottom:30px; 
    border: 1px solid #ddd;
}
.game-toc h4 {
    background: none;
    color: #333;
    padding: 0;
    margin: 0 0 10px 0;
    font-size: 18px;
    border: none;
}
.game-toc ul {
    margin: 0;
    padding-left: 20px;
}

.score-table, .record-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    line-height: 1.8;
}
.score-table th, .score-table td,
.record-table th, .record-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: center;
}
.score-table th, .record-table th {
    background-color: #f2f2f2;
}

/* ゲーセンテーブルの備考列を左寄せ */
.record-table td:nth-child(3) {
    text-align: left;
    padding-left: 12px;
}

/* --- キャラクター紹介用のスタイル --- */
.character-profile {
    margin-top: 40px;
    display: flex; /* Flexboxを有効化 */
    gap: 20px; /* 画像と情報の間のスペース */
    align-items: flex-start; /* 上揃え */
    flex-wrap: wrap; /* 画面が狭い時に折り返す */
}

.character-profile h5 { /* ・ススム など */
    font-size: 20px;
    color: #c00;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    width: 100%; /* h5は見出しなので常に全幅 */
}

.character-profile img {
    max-width: 250px; /* 画像サイズを小さく */
    height: auto;
    display: block;
    border: 1px solid #ddd;
    flex-shrink: 0; /* 画像が縮まないように */
}

.character-stats-and-desc {
    flex: 1; /* 残りのスペースをすべて使う */
}

.character-stats p {
    margin: 5px 0;
    font-size: 14px; /* 少しフォントを小さく */
}

.character-stats span {
    display: inline-block;
    width: 110px; /* ラベル幅を調整 */
    font-weight: bold;
}

.character-description {
    margin-top: 15px;
    line-height: 1.8;
}

/* キャラクターまとめ */
.character-summary {
    margin-top: 40px;
    padding: 20px;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.character-summary h5 {
    margin: 0 0 15px 0;
    padding: 0;
    font-size: 18px;
    color: #333;
    text-align: center;
}
/* --- ここまで --- */

/* フッター */
footer {
    position: relative;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background: #333;
    color: #fff;
    border-top: none; /* 既存の線を削除 */
}

footer p {
    margin: 0;
}

footer .admin-link {
    position: absolute;
    right: 15px;
    bottom: 15px;
    font-size: 0.8em;
}

footer .admin-link a {
    color: #fff;
    text-decoration: none;
}

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

/* アイテムテーブル用のスタイル */
.item-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.item-table th {
    background-color: #333;
    color: #fff;
    padding: 12px 8px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #ddd;
}

.item-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #ddd;
    vertical-align: top;
}

.item-table .item-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.item-table .depth-range {
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: right;
    padding-right: 15px;
    width: 120px;
}

/* アイテム種別ごとの色分け */
.item-essential {
    color: #0066cc;
    font-weight: bold;
}

.item-good {
    color: #0066cc;
}

.item-bad {
    color: #cc0000;
}

.item-avoid {
    color: #cc0000;
    font-weight: bold;
}

.item-neutral {
    color: #333;
}

/* アイテム間の区切り（使用せず） */
.item-separator {
    display: none;
}

/* ブログページ用のスタイル */
.page-header {
    background: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.page-header h2 {
    margin-top: 0;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.blog-list {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.blog-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

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

.blog-item h3 {
    margin: 0 0 5px 0; /* 下マージンを大幅に削減 */
    line-height: 1.4; /* 行間を調整 */
}

.blog-item h3 a {
    text-decoration: none;
    color: #333;
    font-size: 18px;
}

.blog-item h3 a:hover {
    color: #e6b422;
    text-decoration: underline;
}

.blog-meta {
    margin: 0; /* 上マージンを削除 */
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* 掲示板ページ用のスタイル */
.thread-list {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.thread-item {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

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

.thread-item.closed {
    background-color: #f8f9fa;
    opacity: 0.8;
}

.thread-header h3 {
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.thread-header h3 a {
    text-decoration: none;
    color: #333;
    font-size: 18px;
}

.thread-header h3 a:hover {
    color: #e6b422;
    text-decoration: underline;
}

.closed-label {
    color: #dc3545;
    font-size: 14px;
    font-weight: normal;
    margin-left: 10px;
}

.thread-meta {
    color: #666;
    font-size: 14px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.thread-meta span {
    white-space: nowrap;
}

.no-threads {
    background: #fff;
    padding: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #666;
}

/* スレッド詳細ページ */
.thread-detail {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.thread-content {
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.thread-main h3 {
    margin: 0 0 15px 0;
    color: #fff;
    background: #444;
    padding: 15px;
    border-radius: 5px;
    border-bottom: none;
}

.thread-body {
    margin: 15px 0;
    line-height: 1.8;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.thread-info {
    color: #666;
    font-size: 14px;
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.posts-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.posts-list {
    margin-bottom: 30px;
}

.post-item {
    border: 1px solid #eee;
    margin: 15px 0;
    border-radius: 5px;
    background: #fafafa;
}

.post-header {
    background: #f0f0f0;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 14px;
}

.post-number {
    font-weight: bold;
    color: #666;
    min-width: 30px;
}

.post-name {
    font-weight: bold;
    color: #333;
}

.post-date {
    color: #666;
    margin-left: auto;
}

.post-content {
    padding: 15px;
    line-height: 1.8;
    background: #fff;
}

.post-form-section {
    border-top: 2px solid #eee;
    padding-top: 30px;
    margin-top: 30px;
}

.post-form-section h4 {
    margin: 0 0 20px 0;
    color: #333;
}

.post-form .form-group {
    margin-bottom: 20px;
}

.post-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.post-form input[type="text"],
.post-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.post-form textarea {
    resize: vertical;
    min-height: 120px;
}

.char-count {
    font-weight: normal;
    color: #666;
    font-size: 12px;
}

.submit-btn {
    background: #333;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.submit-btn:hover {
    background: #555;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.closed-notice {
    background: #fff3cd;
    color: #856404;
    padding: 20px;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    text-align: center;
    margin-top: 30px;
}