/* ==========================================================================
   RICHELIEU - Premium Rulebook Stylesheet (Baroque / Cardinal Theme)
   ========================================================================== */

/* 1. PALETTE & VARIABLES */
:root {
    --cardinal-red: #7c1427;
    --cardinal-dark: #520b18;
    --cardinal-light: #9a1c32;
    --gold-accent: #c99834;
    --gold-light: #e6be65;
    --gold-dark: #8c651b;
    --parchment-bg: #fbf8f1;
    --parchment-card: #ffffff;
    --parchment-border: #e3d7c3;
    --text-main: #2b1f1d;
    --text-muted: #5e4f4c;
    --shadow-soft: 0 4px 18px rgba(82, 11, 24, 0.08);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* 2. MAIN CONTAINER */
.richelieu-rules-theme {
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 40px;
    font-family: 'Georgia', 'Cambria', 'Times New Roman', serif;
    color: var(--text-main);
    line-height: 1.8;
    background: var(--parchment-bg);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(201, 152, 52, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(124, 20, 39, 0.03) 0%, transparent 40%);
    border-radius: 12px;
    border: 1px solid var(--parchment-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

/* 3. HERO / HEADER */
.richelieu-rules-theme .game-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 25px;
    border-bottom: 2px solid var(--gold-accent);
}

.richelieu-rules-theme .game-header::after {
    content: "⚜";
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--parchment-bg);
    padding: 0 14px;
    color: var(--gold-accent);
    font-size: 22px;
}

.richelieu-rules-theme .game-title {
    font-family: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', 'Georgia', serif;
    font-size: 3.2em;
    font-weight: 700;
    letter-spacing: 3px;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--cardinal-dark) 0%, var(--cardinal-red) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.richelieu-rules-theme .game-subtitle {
    font-size: 1.15em;
    font-style: italic;
    color: var(--cardinal-dark);
    margin: 0;
    letter-spacing: 1px;
}

/* 4. RULES VIEW TOGGLE */
.richelieu-rules-theme .rules-view-toggle {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    align-items: center;
    background: #f4ecdc;
    border: 1px solid var(--parchment-border);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.95em;
    margin-bottom: 25px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.richelieu-rules-theme .rules-view-toggle a {
    color: var(--cardinal-red);
    text-decoration: none;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.richelieu-rules-theme .rules-view-toggle a:hover {
    background: #ffffff;
    border-color: var(--gold-accent);
    color: var(--cardinal-dark);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* 5. SUMMARY INFO & NOTICES */
.richelieu-rules-theme .summaryInfo {
    background: linear-gradient(135deg, #fdf9f0 0%, #f9f1e1 100%);
    border-left: 5px solid var(--gold-accent);
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 0.98em;
    line-height: 1.7;
    margin-bottom: 24px;
    color: #4a3821;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    font-style: italic;
}

.richelieu-rules-theme .summary {
    background: #fdf5e6;
    border-left: 4px solid var(--gold-accent);
    padding: 12px 18px;
    font-style: italic;
    font-size: 0.96em;
    line-height: 1.7;
    margin: 12px 0 20px 0;
    border-radius: 0 8px 8px 0;
    color: #5c3a1e;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.richelieu-rules-theme .summary strong,
.richelieu-rules-theme .summaryInfo strong {
    color: var(--cardinal-red);
}

/* 6. HISTORICAL FLAVOR / PREMISE BOX */
.richelieu-rules-theme .flavor-banner {
    display: flex;
    align-items: center;
    gap: 25px;
    background: #ffffff;
    border: 1px solid var(--parchment-border);
    border-left: 6px solid var(--cardinal-red);
    border-radius: 10px;
    padding: 20px 24px;
    margin: 25px 0 30px 0;
    box-shadow: var(--shadow-card);
}

.richelieu-rules-theme .flavor-cover {
    width: 140px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--gold-light);
    flex-shrink: 0;
}

.richelieu-rules-theme .flavor-text {
    font-size: 1.05em;
    line-height: 1.75;
    color: var(--text-main);
    font-style: italic;
}

.richelieu-rules-theme .flavor-text strong {
    color: var(--cardinal-dark);
    font-style: normal;
}

/* 7. CHAPTERS & SECTIONS */
.richelieu-rules-theme .chapter {
    background: var(--parchment-card);
    border: 1px solid var(--parchment-border);
    border-radius: 10px;
    padding: 24px 30px;
    margin: 26px 0;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.richelieu-rules-theme .chapter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--cardinal-red) 0%, var(--gold-accent) 100%);
    border-radius: 4px 0 0 4px;
}

.richelieu-rules-theme .chapter .title,
.richelieu-rules-theme h2 {
    font-family: 'Cinzel', 'Palatino Linotype', 'Georgia', serif;
    font-size: 1.45em;
    color: var(--cardinal-dark);
    font-weight: 700;
    border-bottom: 1.5px solid #ebdcc5;
    padding-bottom: 10px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.richelieu-rules-theme h3 {
    font-family: 'Georgia', serif;
    font-size: 1.18em;
    color: var(--cardinal-red);
    margin: 22px 0 10px 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.richelieu-rules-theme h3::before {
    content: "◆";
    font-size: 0.8em;
    color: var(--gold-accent);
}

/* 8. MATERIAL & COMPONENTS SHOWCASE */
.richelieu-rules-theme .material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.richelieu-rules-theme .material-card {
    background: #fffdf9;
    border: 1px solid var(--parchment-border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.richelieu-rules-theme .material-card-title {
    font-weight: bold;
    color: var(--cardinal-dark);
    font-size: 1.02em;
    margin-bottom: 10px;
}

.richelieu-rules-theme .material-card-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 80px;
    margin: 8px 0;
}

.richelieu-rules-theme .card-preview-img {
    height: 85px;
    width: auto;
    border-radius: 4px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.richelieu-rules-theme .card-preview-img:hover {
    transform: translateY(-3px) scale(1.04);
}

.richelieu-rules-theme .marker-preview-img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.richelieu-rules-theme .tile-preview-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.richelieu-rules-theme .material-card-desc {
    font-size: 0.9em;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 6px;
}

/* 9. SETUP DISPLAY (4 Rows of Cards) */
.richelieu-rules-theme .setup-illustration {
    background: #f5eedf;
    border: 1px dashed var(--gold-dark);
    border-radius: 8px;
    padding: 16px;
    margin: 18px 0;
    text-align: center;
}

.richelieu-rules-theme .setup-diagram {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin: 12px 0;
}

.richelieu-rules-theme .setup-row {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.richelieu-rules-theme .setup-card-mini {
    width: 36px;
    height: 24px;
    background: #ffffff;
    border: 1px solid #7c1427;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: var(--cardinal-dark);
}

.richelieu-rules-theme .setup-card-mini.outer {
    background: #ffe3e8;
    border-color: #b30021;
    box-shadow: 0 0 5px rgba(200, 0, 40, 0.4);
}

.richelieu-rules-theme .setup-card-mini.tile-on {
    position: relative;
}

.richelieu-rules-theme .setup-card-mini.tile-on::after {
    content: "●";
    position: absolute;
    color: var(--gold-accent);
    font-size: 12px;
}

/* 10. LISTS & STEP INSTRUCTIONS */
.richelieu-rules-theme ul,
.richelieu-rules-theme ol {
    padding-left: 24px;
    margin: 12px 0 16px 0;
}

.richelieu-rules-theme li {
    margin-bottom: 10px;
    line-height: 1.75;
}

.richelieu-rules-theme li strong {
    color: var(--cardinal-dark);
}

.richelieu-rules-theme .fleur-list {
    list-style: none;
    padding-left: 0;
}

.richelieu-rules-theme .fleur-list li {
    position: relative;
    padding-left: 24px;
}

.richelieu-rules-theme .fleur-list li::before {
    content: "⚜";
    position: absolute;
    left: 0;
    color: var(--gold-accent);
    font-size: 14px;
}

/* 11. HIGHLIGHT & EXAMPLE BOXES */
.richelieu-rules-theme .important-note {
    background: #fff4f4;
    border: 1px solid #f2c7ce;
    border-left: 5px solid var(--cardinal-red);
    padding: 14px 18px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
    color: #5c141d;
    line-height: 1.7;
}

.richelieu-rules-theme .important-note strong {
    color: var(--cardinal-red);
    text-transform: uppercase;
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

.richelieu-rules-theme .example-box {
    background: #fcf9f2;
    border: 1px solid #ebdcc5;
    border-left: 5px solid var(--gold-accent);
    padding: 14px 18px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
    color: #4a3e2a;
    font-style: italic;
    line-height: 1.7;
}

.richelieu-rules-theme .example-box strong {
    font-style: normal;
    color: var(--cardinal-dark);
    display: block;
    margin-bottom: 4px;
}

.richelieu-rules-theme .scoring-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--parchment-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.richelieu-rules-theme .scoring-table th {
    background: linear-gradient(180deg, var(--cardinal-dark) 0%, var(--cardinal-red) 100%);
    color: #ffffff;
    font-family: 'Cinzel', 'Palatino Linotype', serif;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.98em;
    letter-spacing: 0.5px;
}

.richelieu-rules-theme .scoring-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--parchment-border);
    vertical-align: top;
    line-height: 1.6;
}

.richelieu-rules-theme .scoring-table tr:nth-child(even) td {
    background: #faf6ee;
}

.richelieu-rules-theme .scoring-table tr:last-child td {
    border-bottom: none;
}

.richelieu-rules-theme .badge-cardinal {
    display: inline-block;
    background: var(--cardinal-red);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85em;
    margin-right: 6px;
}

.richelieu-rules-theme .badge-gold {
    display: inline-block;
    background: var(--gold-accent);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85em;
    margin-right: 6px;
}

/* 12. VISIBILITY TOGGLE LOGIC */
.rules[showrules="summary"] .fullOnly,
.rules[showrules="summary"] .hasSummary {
    display: none !important;
}

.rules[showrules="full"] .summaryInfo,
.rules[showrules="full"] .summary {
    display: none !important;
}

.rules[showrules="both"] .onShowRulesBoth {
    display: inline;
}

.rules:not([showrules="both"]) .onShowRulesBoth {
    display: none;
}

/* 13. RESPONSIVE BREAKPOINTS */
@media (max-width: 768px) {
    .richelieu-rules-theme {
        padding: 18px 16px;
    }
    .richelieu-rules-theme .game-title {
        font-size: 2.2em;
    }
    .richelieu-rules-theme .flavor-banner {
        flex-direction: column;
        text-align: center;
    }
    .richelieu-rules-theme .flavor-cover {
        width: 120px;
    }
    .richelieu-rules-theme .material-grid {
        grid-template-columns: 1fr;
    }
}
