/* ===== リセット & ベース ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Meiryo", sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.7;
    min-height: 100vh;
}

/* ===== ヘッダー + ナビ一体型 ===== */
.page-header {
    background: #fff;
    padding: 16px 0 0;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.page-header h1 {
    font-size: 1.4rem;
    color: #d32f2f;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

/* ===== ナビゲーションタブ（ヘッダー内に移動） ===== */
.nav-tabs {
    display: flex;
    gap: 0;
    justify-content: center;
    max-width: 860px;
    margin: 0 auto;
}

.nav-tab {
    flex: 1;
    max-width: 200px;
    text-align: center;
    padding: 10px 12px;
    background: transparent;
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 3px solid transparent;
}

.nav-tab:hover {
    color: #d32f2f;
}

.nav-tab.active {
    color: #d32f2f;
    border-bottom-color: #d32f2f;
}

/* ===== コンテナ ===== */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ===== カード ===== */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 1.2rem;
    color: #d32f2f;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
    display: inline-block;
    width: 100%;
}

/* ===== テーブル（ドロップ） ===== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.orb-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}

.orb-table thead th {
    background: #fafafa;
    color: #333;
    padding: 10px 14px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #d32f2f;
}

.orb-table tbody td,
.orb-table tbody th {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.orb-table tbody tr:hover td {
    background: #fdf2f2;
}

/* オーブ名セル */
.orb-name {
    font-weight: bold;
    font-size: 0.95rem;
    text-align: center;
    white-space: nowrap;
}

.orb-red    { color: #d32f2f; }
.orb-silver { color: #757575; }
.orb-green  { color: #2e7d32; }
.orb-blue   { color: #1565c0; }
.orb-yellow { color: #f9a825; }
.orb-purple { color: #7b1fa2; }

/* ===== オーブ収集セクション ===== */
.orb-section {
    margin-bottom: 16px;
    padding: 16px;
    border-left: 4px solid #d32f2f;
    background: #fafafa;
    border-radius: 0 8px 8px 0;
}

.orb-section strong {
    color: #333;
}

.orb-section ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.orb-section li {
    margin-bottom: 4px;
    color: #555;
}

/* 地図リンク */
.map-link {
    cursor: pointer;
    color: #1565c0;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.map-link:hover {
    color: #d32f2f;
    text-decoration: underline;
}

/* 地図詳細 */
.map-detail-inner {
    margin-top: 10px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    color: #444;
}

/* ===== 地図データセクション ===== */
.map-card {
    margin-bottom: 12px;
    padding: 14px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.map-card strong {
    color: #d32f2f;
}

/* ===== 職業ステータス表 ===== */
.job-stat-details {
    margin-top: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.job-stat-summary {
    cursor: pointer;
    user-select: none;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: bold;
    color: #333;
    background: #fafafa;
    list-style: none;
}

.job-stat-summary::-webkit-details-marker { display: none; }
.job-stat-summary::before { content: "▶ "; font-size: 0.75rem; color: #888; }
details.job-stat-details[open] .job-stat-summary::before { content: "▼ "; }

.job-stat-controls {
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.stat-mode-btn {
    cursor: pointer;
    padding: 4px 12px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #f0f0f0;
    font-size: 0.85rem;
    color: #333;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.stat-mode-btn:hover {
    background: #e8e8e8;
}
.stat-mode-btn[data-mode="1"] {
    border-color: #1565c0;
    color: #1565c0;
    background: #e8f0fe;
}
.stat-mode-btn[data-mode="2"] {
    border-color: #d32f2f;
    color: #d32f2f;
    background: #fdecea;
}
.stat-mode-btn[data-mode="3"] {
    border-color: #2e7d32;
    color: #2e7d32;
    background: #e8f5e9;
}

.job-stat-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85rem;
}

.job-stat-table thead th {
    background: #fafafa;
    color: #333;
    padding: 8px 10px;
    text-align: right;
    font-weight: bold;
    border-bottom: 2px solid #d32f2f;
    white-space: nowrap;
}

.job-stat-table thead th:first-child {
    text-align: left;
}

.job-stat-table tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid #eee;
    text-align: right;
    color: #333;
}

.job-stat-table tbody td:first-child {
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
}

.job-stat-table tbody tr:hover td {
    background: #fdf2f2;
}

.job-stat-table td.stat-blue  { color: #1565c0; }
.job-stat-table td.stat-red   { color: #d32f2f; }
.job-stat-table td.stat-green { color: #2e7d32; }

/* ===== ボス地図入手（details） ===== */
details {
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

details summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: "▶ ";
    display: inline;
}

details[open] summary::before {
    content: "▼ ";
}

summary.card-title {
    margin-bottom: 8px;
}

details[open] summary.card-title {
    margin-bottom: 16px;
}

/* ルート見出し */
.boss-route {
    margin-bottom: 20px;
}

.route-title {
    font-size: 1rem;
    color: #e65100;
    margin-bottom: 10px;
    padding-left: 8px;
    border-left: 3px solid #e65100;
}

/* ボスリスト */
.boss-list {
    padding-left: 12px;
}

.boss-list dt {
    font-weight: bold;
    color: #1565c0;
    margin-top: 10px;
}

.boss-list dt::before {
    content: "📜 ";
}

.boss-list dd {
    margin-left: 20px;
    color: #555;
    margin-bottom: 4px;
}

/* ===== カウンター ===== */
#section-counter ul {
    margin: 8px 0 12px 20px;
    padding: 0;
}

.counter-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.counter-value {
    font-size: 2.4rem;
    font-weight: bold;
    color: #333;
    min-width: 80px;
    text-align: center;
    letter-spacing: 0.04em;
}

.counter-btn {
    border: none;
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 20px;
    transition: opacity 0.15s, transform 0.1s;
    user-select: none;
}

.counter-btn:active {
    opacity: 0.75;
    transform: scale(0.95);
}

.counter-btn-red {
    background: #d32f2f;
    color: #fff;
}

.counter-btn-blue {
    background: #1565c0;
    color: #fff;
}

.counter-btn-green {
    background: #47c94d;
    color: #fff;
}

.counter-btn-reset {
    background: #e0e0e0;
    color: #555;
    font-size: 1rem;
    padding: 8px 14px;
}

/* ===== 画像トグル（ホイミテーブル等） ===== */
.table-image-container {
    margin-top: 12px;
}

.image-toggle {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.image-toggle-summary {
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
    background: #fafafa;
    list-style: none;
}

.image-toggle-summary::-webkit-details-marker { display: none; }

.image-toggle-summary::before {
    content: "▶ ";
    font-size: 0.75rem;
}

details.image-toggle[open] .image-toggle-summary::before {
    content: "▼ ";
}

.image-toggle-body {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    background: #fff;
}

.hoimi-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* ===== 地図画像（地図データ・オーブ収集） ===== */
.map-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    margin-top: 6px;
    display: block;
}

.map-image-toggle {
    margin-top: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.map-image-summary {
    cursor: pointer;
    user-select: none;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #1565c0;
    background: #f0f4ff;
    list-style: none;
}

.map-image-summary::-webkit-details-marker { display: none; }

.map-image-summary::before { content: "▶ "; font-size: 0.75rem; }
details.map-image-toggle[open] .map-image-summary::before { content: "▼ "; }

.map-image-toggle img {
    padding: 8px;
    background: #fff;
}

.special-map-notes {
    list-style: disc;
    margin: 4px 0 4px 20px;
    padding: 8px;
    background: #fff;
    color: #444;
}

.map-location-img {
    margin-top: 10px;
}

.map-img-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
}

/* ===== 参考リンク ===== */
.link-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-list li a {
    display: inline-block;
    color: #1565c0;
    text-decoration: none;
    padding: 2px 0;
    transition: color 0.2s;
}

.link-list li a:hover {
    color: #d32f2f;
    text-decoration: underline;
}

/* ===== レスポンシブ ===== */
@media (max-width: 600px) {
    html {
        scroll-padding-top: 100px;
    }

    .page-header h1 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .container {
        padding: 12px 8px 40px;
    }

    .card {
        padding: 16px 12px;
        border-radius: 8px;
    }

    .nav-tab {
        font-size: 0.72rem;
        padding: 8px 4px;
    }

    .orb-table {
        font-size: 0.8rem;
    }

    .orb-table thead th,
    .orb-table tbody td,
    .orb-table tbody th {
        padding: 8px 8px;
    }
}
