/* ==========================================================================
   Targi 2 Rules Styling - Yucata Game Plugin
   Theme: Sahara Desert, Warm Sand, Indigo/Tuareg Blue, Ancient Borders
   ========================================================================== */

.rules {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #3b2c1a;
    background-color: #fdfaf3;
    line-height: 1.6;
    font-size: 1rem;
}

#rulesPage .rules,
.modal.rules .modal-body {
    background-color: #fdfaf3;
    color: #3b2c1a;
    padding: 1.5rem;
}

/* Container & Layout */
.rules .targi-rules-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Hero Header */
.rules .targi-hero {
    background: linear-gradient(135deg, #102538 0%, #1a3d5c 50%, #2a5578 100%);
    color: #f7ede2;
    border-radius: 12px;
    padding: 1.8rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.8rem;
    box-shadow: 0 6px 18px rgba(16, 37, 56, 0.25);
    border-left: 6px solid #d49b38;
}

.rules .targi-hero-cover {
    width: 110px;
    height: 110px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 2px solid #e2b35a;
    flex-shrink: 0;
}

.rules .targi-hero-text h1 {
    margin: 0 0 0.4rem 0;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #f5c469;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.rules .targi-hero-text p {
    margin: 0;
    font-size: 1.05rem;
    color: #e5edf5;
    line-height: 1.4;
}

/* Typography & Headings */
.rules h2 {
    color: #173b5c;
    font-size: 1.45rem;
    font-weight: 700;
    border-bottom: 2px solid #e8d7be;
    padding-bottom: 0.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rules h2::before {
    content: "❖";
    color: #c9882a;
    font-size: 1.1rem;
}

.rules h3 {
    color: #8c4314;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 1.4rem;
    margin-bottom: 0.5rem;
}

.rules strong {
    color: #1d334a;
}

/* Text Sections */
.rules p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Highlight / Cards & Materials Showcase */
.rules .targi-card-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fffdf8;
    border: 1px solid #e3d2b8;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(92, 64, 28, 0.06);
    margin: 1.2rem 0;
    overflow: hidden;
}

.rules .targi-card-table th {
    background: #f3e5ce;
    color: #5c3b12;
    padding: 10px 14px;
    font-weight: 700;
    border-bottom: 2px solid #deb881;
}

.rules .targi-card-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0e4d0;
    vertical-align: middle;
}

.rules .targi-card-table tr:last-child td {
    border-bottom: none;
}

/* Component Badges & Tokens */
.rules .material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 1.2rem 0 1.8rem 0;
}

.rules .material-card {
    background: #fffcf5;
    border: 1px solid #ebd9be;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(100, 70, 30, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rules .material-card .mat-imgs {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.rules .material-card .mat-imgs img {
    max-height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}

.rules .material-card .mat-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #243f5a;
}

.rules .material-card .mat-desc {
    font-size: 0.82rem;
    color: #6d5b45;
    margin-top: 2px;
}

/* Card Showcase Gallery */
.rules .card-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #faf3e6;
    border-radius: 8px;
    border: 1px dashed #d9c4a5;
    margin: 8px 0 16px 0;
}

.rules .card-gallery img {
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.rules .card-gallery img:hover {
    transform: translateY(-3px) scale(1.05);
}

/* Symbol Gallery (5 Symbols for Clan Cards) */
.rules .symbol-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 1.2rem 0;
}

.rules .symbol-card {
    background: #fffcf4;
    border: 1px solid #dfcca9;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.rules .symbol-card img {
    height: 52px;
    width: auto;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.rules .symbol-card .sym-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #173b5c;
}

/* Step-by-Step Flow */
.rules .step-box {
    background: #ffffff;
    border: 1px solid #ebdcc5;
    border-left: 5px solid #1a4971;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 1.2rem 0;
    box-shadow: 0 2px 8px rgba(70, 45, 15, 0.05);
}

.rules .step-box.robber-step { border-left-color: #595e63; }
.rules .step-box.targi-step { border-left-color: #1a568c; }
.rules .step-box.marker-step { border-left-color: #b0701e; }
.rules .step-box.action-step { border-left-color: #8c2a1e; }
.rules .step-box.endround-step { border-left-color: #3b7352; }

.rules .step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #102e4a;
    margin-bottom: 8px;
}

.rules .step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #173b5c;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.88rem;
    font-weight: 800;
}

.rules .step-box.robber-step .step-badge { background: #52585e; }
.rules .step-box.targi-step .step-badge { background: #1a568c; }
.rules .step-box.marker-step .step-badge { background: #b0701e; }
.rules .step-box.action-step .step-badge { background: #8c2a1e; }
.rules .step-box.endround-step .step-badge { background: #3b7352; }

/* Example Containers */
.rules .example-box {
    background: #f7f1e4;
    border: 1px solid #deb881;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 1.2rem 0;
    text-align: center;
}

.rules .example-box .example-text {
    text-align: justify;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.rules .example-box img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #c9b08b;
    box-shadow: 0 4px 12px rgba(70, 45, 15, 0.12);
    margin: 6px 0;
}

/* Yucata Hint Box */
.rules .yucata-hint {
    background: #eaf1f7;
    border: 1px solid #b2c9dc;
    border-left: 5px solid #235784;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 1.2rem 0;
    color: #1a3954;
    font-size: 0.95rem;
}

.rules .yucata-hint strong {
    color: #173b5c;
}

.rules .yucata-hint img {
    vertical-align: middle;
    margin: 0 3px;
}

/* Border Cards Reference List / Table */
.rules .border-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 1.2rem 0;
}

.rules .border-card-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #eadbca;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 2px 6px rgba(80, 50, 20, 0.04);
}

.rules .border-card-item img {
    width: 120px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.rules .border-card-content {
    flex: 1;
}

.rules .border-card-content strong {
    display: block;
    font-size: 1.05rem;
    color: #8a4115;
    margin-bottom: 4px;
}

.rules .border-card-content p {
    margin: 0;
    font-size: 0.93rem;
    color: #423526;
    text-align: left;
}

/* Highlight Banner for Important Rules */
.rules .rule-alert {
    background: #fdf2e9;
    border: 1px solid #f0cdab;
    border-left: 4px solid #d96b27;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 0.8rem 0;
    font-size: 0.93rem;
}

/* Floating Card / Images for Section Intros */
.rules .float-card-left {
    float: left;
    margin-right: 14px;
    margin-bottom: 8px;
    border-radius: 6px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    max-width: 130px;
}

.rules .clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Lists */
.rules ul {
    padding-left: 1.4rem;
    margin: 0.6rem 0 1rem 0;
}

.rules li {
    margin-bottom: 0.4rem;
}

/* FAQ Section */
.rules .targi-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 1.2rem 0;
}

.rules .faq-item {
    background: #ffffff;
    border: 1px solid #ebd9bf;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 2px 6px rgba(59, 44, 26, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rules .faq-item:hover {
    box-shadow: 0 4px 12px rgba(59, 44, 26, 0.1);
    border-color: #d49b38;
}

.rules .faq-question {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #173b5c;
    margin-bottom: 8px;
}

.rules .faq-num {
    background: #173b5c;
    color: #f7ede2;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.rules .faq-answer {
    color: #3b2c1a;
    font-size: 0.96rem;
    line-height: 1.55;
    margin: 0;
    padding-left: 2px;
}

.rules .faq-answer p {
    margin: 0.4rem 0;
}

.rules .faq-answer ul {
    margin: 0.4rem 0;
    padding-left: 1.2rem;
}

.rules .faq-answer li {
    margin-bottom: 0.3rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .rules .targi-hero {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem;
    }
    .rules .symbol-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .rules .border-card-item {
        flex-direction: column;
        text-align: center;
    }
    .rules .border-card-item img {
        width: 140px;
    }
    .rules .border-card-content p {
        text-align: center;
    }
    .rules .float-card-left {
        float: none;
        display: block;
        margin: 0 auto 10px auto;
    }
    .rules .faq-question {
        flex-direction: column;
        gap: 4px;
    }
}

