/* Allow sticky sidebar by removing overflow:hidden on #all */
#all {
    overflow: visible;
}

/* ========================================================
   MOD Settings Guide Layout
======================================================== */
.mod-sg-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 100px 20px 40px 20px;
    font-family: sans-serif;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* --- Sidebar --- */
.mod-sg-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    max-height: calc(100vh - 105px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 20;
    padding-right: 2px;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.25) transparent;
}

.mod-sg-sidebar::-webkit-scrollbar {
    width: 4px;
}

.mod-sg-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.mod-sg-sidebar::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: 4px;
}

.sg-nav-menu,
.sg-about-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.sg-nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sg-nav-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.sg-nav-menu li:last-child {
    border-bottom: none;
}

.sg-nav-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    text-decoration: none;
    color: #555;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}

.sg-nav-menu a:hover {
    background: #f9f9f9;
    color: #6366f1;
}

.sg-nav-menu a.active {
    color: #6366f1;
    background: #f0f4ff;
    border-left: 4px solid #6366f1;
}

.sg-about-box {
    text-align: left;
    padding: 20px;
    background: #f5f3ff;
    border: 1px solid #e0dcfc;
}

.sg-about-title {
    color: #6366f1;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.sg-about-text {
    font-size: 13px;
    line-height: 1.6;
    color: #444;
}

/* --- Main Content --- */
.mod-sg-main {
    flex: 1;
    min-width: 0;
}

.sg-header-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    border-bottom: 4px solid #6366f1;
}

.sg-header-icon {
    font-size: 40px;
    color: #6366f1;
}

.sg-header-title {
    font-size: 32px;
    font-weight: bold;
    color: #222;
    margin: 0 0 5px 0;
}

.sg-header-desc {
    text-align: left;
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* --- Section Title --- */
.sg-section-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* --- Settings Grid (TierSpawnConfig) --- */
.sg-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.sg-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sg-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
    padding: 20px;
    scroll-margin-top: 120px;
}

.sg-card-title {
    font-size: 24px;
    font-weight: bold;
    color: #d32f2f;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f8d7da;
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.sg-card-title.blue {
    color: #007bff;
    border-color: #cce5ff;
}

.sg-card-title.green {
    color: #28a745;
    border-color: #c3e6cb;
}

.sg-card-title.orange {
    color: #fd7e14;
    border-color: #ffe8d6;
}

.sg-mod-title-icon {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    vertical-align: middle;
    flex-shrink: 0;
}

/* Table styling for settings */
.sg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sg-table th,
.sg-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.sg-table th {
    background: #f9f9f9;
    color: #555;
    font-weight: normal;
}

.sg-table td strong {
    color: #222;
}

/* Simple key-value setting */
.sg-setting-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

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

.sg-setting-icon {
    font-size: 24px;
    color: #007bff;
    margin-top: 5px;
}

.sg-setting-content h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
}

.sg-setting-val {
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    margin-bottom: 5px;
}

.sg-setting-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Examples Box */
.sg-example-box {
    background: #fdfbf7;
    border: 1px solid #f0e6d2;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.sg-example-title {
    font-weight: bold;
    color: #28a745;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.sg-example-title.red {
    color: #d32f2f;
}

.sg-example-title.orange {
    color: #fd7e14;
}

.sg-example-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: #444;
}

.sg-example-list li {
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}

.sg-example-list li::before {
    content: "✓";
    color: #28a745;
    position: absolute;
    left: 0;
}

.sg-example-list.red li::before {
    color: #d32f2f;
}

.sg-example-list.orange li::before {
    color: #fd7e14;
}

/* Alerts / Notes */
.sg-alert {
    background: #fff3f3;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.sg-alert-title {
    color: #d32f2f;
    font-weight: bold;
    margin: 0 0 10px 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sg-alert ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #444;
    text-align: left;
    line-height: 1.6;
}

/* Player Scaling Layout */
.ps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.ps-basic-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ps-basic-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.ps-basic-item.orange {
    border-left-color: #fd7e14;
}

.ps-basic-item .goal {
    font-weight: bold;
    color: #28a745;
    font-size: 13px;
    width: 120px;
    flex-shrink: 0;
}

.ps-basic-item.orange .goal {
    color: #fd7e14;
}

.ps-basic-item .action {
    font-size: 13px;
    color: #444;
    line-height: 1.4;
}

/* FAQ Box */
.sg-faq-box {
    background: #f5f3ff;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.sg-faq-box h3 {
    color: #6366f1;
    margin: 0 0 10px 0;
}

.sg-faq-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 30px;
    background: #6366f1;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: background 0.2s;
}

.sg-faq-btn:hover {
    background: #4f46e5;
    color: #fff;
}

@media (max-width: 900px) {
    .mod-sg-wrapper {
        flex-direction: column;
    }

    .mod-sg-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }

    .sg-grid {
        grid-template-columns: 1fr;
    }

    .ps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sg-section-title {
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    .sg-section-desc {
        display: block;
        width: 100%;
        margin-left: 0;
        font-size: 12px;
        line-height: 1.5;
    }
}


/* --- New Guide Layout Styles --- */
.guide-step-cards {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.guide-step-card {
    flex: 1;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.guide-step-card:hover {
    border-color: #6366f1;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.1);
}

.guide-step-card i {
    font-size: 24px;
}

.guide-step-card.red i {
    color: #d32f2f;
}

.guide-step-card.blue i {
    color: #007bff;
}

.guide-step-card.green i {
    color: #28a745;
}

.guide-step-card.orange i {
    color: #fd7e14;
}

.guide-step-card.purple i {
    color: #6f42c1;
}

.guide-step-card strong {
    font-size: 14px;
}

.guide-step-card span {
    font-size: 12px;
    color: #666;
}

.guide-step-card.red strong {
    color: #d32f2f;
}

.guide-step-card.blue strong {
    color: #007bff;
}

.guide-step-card.green strong {
    color: #28a745;
}

.guide-step-card.orange strong {
    color: #fd7e14;
}

.guide-step-card.purple strong {
    color: #6f42c1;
}

.mod-sub-section {
    margin-bottom: 25px;
}

.mod-sub-section h5 {
    font-size: 16px;
    margin: 0 0 5px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mod-sub-section.red h5 {
    color: #d32f2f;
    border-color: #f8d7da;
}

.mod-sub-section.green h5 {
    color: #28a745;
    border-color: #c3e6cb;
}

.mod-sub-section p {
    font-size: 13px;
    color: #555;
    margin: 0 0 10px 0;
}

.mod-sub-content {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mod-example-box {
    flex: 1;
    min-width: 150px;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mod-example-box.red {
    background: #fff5f5;
    border: 1px solid #f8d7da;
}

.mod-example-box.green {
    background: #f8fff9;
    border: 1px solid #c3e6cb;
}

.mod-example-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 8px;
}

.mod-example-box.red .mod-example-title {
    color: #d32f2f;
}

.mod-example-box.green .mod-example-title {
    color: #28a745;
}

.tips-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: stretch;
}

.tip-card {
    flex: 1;
    min-width: 130px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.tip-card strong {
    color: #007bff;
    font-size: 13px;
    margin: 0;
}

.tip-card i {
    font-size: 20px;
    color: #666;
}

.tip-arrow {
    display: flex;
    align-items: center;
    color: #ccc;
}

.qa-card {
    background: #f5f3ff;
    border: 1px solid #e0dcfc;
    border-radius: 8px;
    padding: 20px;
    flex: 1.5;
    min-width: 250px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.qa-card h4 {
    color: #6366f1;
    margin: 0 0 10px 0;
    font-size: 15px;
}

.qa-card p {
    color: #555;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.qa-btn {
    display: inline-block;
    background: #6366f1;
    color: #fff;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    transition: background 0.2s;
}

.qa-btn:hover {
    background: #4f46e5;
    color: #fff;
}

/* --- Intro Section & Inline Style Refactoring --- */
.sg-intro-card {
    margin-bottom: 40px;
    border-left: 5px solid #6366f1;
    background: #fafaff;
    text-align: left;
}

.sg-intro-title {
    color: #6366f1;
    margin: 0 0 15px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-intro-flex {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.sg-intro-img-col {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sg-intro-img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #eef0ff;
}

.sg-intro-text-col {
    flex: 1;
    min-width: 250px;
    text-align: left;
}

.sg-intro-text {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    margin: 0 0 12px 0;
}

.sg-intro-text.light {
    color: #555;
}

.sg-intro-highlight {
    color: #6366f1;
    font-size: 15px;
}

.sg-intro-hint {
    background: #fff;
    border: 1px dashed #6366f1;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
}

.sg-step-title {
    color: #333;
    font-size: 15px;
    border-bottom: 2px solid #eef0ff;
    padding-bottom: 5px;
    margin: 0 0 10px 0;
}

.sg-step-label {
    color: #6366f1;
}

.sg-note-text {
    font-size: 13px;
    color: #666;
}

.mt-15 {
    margin-top: 15px !important;
}

.mt-20 {
    margin-top: 20px !important;
}

.mt-25 {
    margin-top: 25px !important;
}

/* --- Action List (Section 1) --- */
.sg-action-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.sg-action-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.sg-action-item:hover {
    border-color: #6366f1;
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.1);
}

.sg-action-item i:first-child {
    font-size: 24px;
    width: 30px;
    text-align: center;
}

.sg-action-item.red {
    border-left: 5px solid #d32f2f;
}

.sg-action-item.red i:first-child {
    color: #d32f2f;
}

.sg-action-item.green {
    border-left: 5px solid #28a745;
}

.sg-action-item.green i:first-child {
    color: #28a745;
}

.sg-action-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sg-action-title {
    font-size: 15px;
    font-weight: bold;
}

.sg-action-desc {
    font-size: 12px;
    color: #666;
}

.sg-action-arrow {
    color: #ccc;
    font-size: 18px;
}

.sg-action-item:hover .sg-action-arrow {
    color: #6366f1;
}

.sg-simple-index {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.sg-simple-index li {
    margin-bottom: 8px;
}

.sg-simple-index a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #444;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.sg-simple-index a:hover {
    background: #f0f4ff;
    color: #6366f1;
}

.icon-orange {
    color: #fd7e14;
}

.icon-indigo {
    color: #6366f1;
}

.icon-red {
    color: #d32f2f;
}

.icon-blue {
    color: #007bff;
}

.icon-green {
    color: #28a745;
}

.sg-section-desc {
    text-align: left;
    font-size: 13px;
    font-weight: normal;
    color: #666;
    margin-left: auto;
}

.sg-card.border-red {
    border: 2px solid #f8d7da;
}

.sg-card.border-green {
    border: 2px solid #c3e6cb;
}

.sg-card-title-desc {
    font-size: 14px;
    font-weight: normal;
    color: #666;
    margin-left: 10px;
}

.sg-table-flex {
    flex: 2;
    min-width: 300px;
}

.mod-example-value {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.mod-example-note {
    font-size: 12px;
    color: #666;
    display: block;
}

.mod-example-hint {
    margin-top: 15px;
    background: #fffaf0;
    border: 1px solid #ffe8cc;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    text-align: left;
    color: #d32f2f;
}

.mod-sub-flex-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mod-sub-section-col {
    flex: 1;
    min-width: 250px;
}

.mod-setting-box {
    background: #f0f4ff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.mod-setting-desc {
    font-size: 12px;
    color: #555;
    display: block;
}

.mod-setting-default {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.mod-setting-divider {
    border: 0;
    border-top: 1px dashed #ccc;
    margin: 10px 0;
}

.table-sub-text {
    font-size: 11px;
    color: #666;
}

.mod-example-inner-box {
    text-align: left;
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
}

.mod-example-inner-box.flex-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mod-example-label-green {
    font-size: 11px;
    color: #28a745;
    font-weight: bold;
}

.mod-example-val-text {
    font-size: 14px;
}

.flex-1 {
    flex: 1;
}

.no-mb {
    margin-bottom: 0 !important;
}

.sg-alert-warning {
    background: #fffdf5;
    border-color: #ffeeba;
    color: #856404;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 20px;
}

.sg-alert-icon {
    font-size: 24px;
    color: #ffc107;
}

.sg-alert-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.sg-alert-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
}

.tip-card-title {
    font-weight: bold;
}

.tip-card-title.red {
    color: #d32f2f;
}

.tip-card-title.blue {
    color: #007bff;
}

.tip-card-title.green {
    color: #28a745;
}

.tip-card-title.orange {
    color: #fd7e14;
}

.tip-card-desc {
    text-align: left;
    font-size: 11px;
    color: #555;
}

.qa-btn-wrapper {
    text-align: right;
}

/* --- MOD名から探す (Mod Navigation Grid) --- */
.sg-mod-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 35px;
}

.sg-mod-nav-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    text-decoration: none;
    color: #333;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.sg-mod-nav-card.red {
    border-left: 5px solid #d32f2f;
}

.sg-mod-nav-card.green {
    border-left: 5px solid #28a745;
}

.sg-mod-nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.12);
    border-color: #c7d2fe;
}

.sg-mod-nav-card.red:hover {
    border-color: #fca5a5;
    border-left-color: #d32f2f;
}

.sg-mod-nav-card.green:hover {
    border-color: #86efac;
    border-left-color: #28a745;
}

.sg-mod-nav-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.sg-mod-nav-info {
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sg-mod-nav-name {
    font-size: 15px;
    font-weight: bold;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sg-mod-nav-card.red .sg-mod-nav-name {
    color: #d32f2f;
}

.sg-mod-nav-card.green .sg-mod-nav-name {
    color: #28a745;
}

.sg-mod-nav-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.sg-mod-nav-arrow {
    font-size: 14px;
    color: #cbd5e1;
    transition: transform 0.2s, color 0.2s;
    flex-shrink: 0;
}

.sg-mod-nav-card:hover .sg-mod-nav-arrow {
    color: #6366f1;
    transform: translateX(3px);
}