/* add all special styles used for displaying the rules */
/* .rules: used for all elements loading rules (rules at main site, rules ingame, popup with rules extract
   #rules: div with complete rules used at main site
   #rulesPage: ingame rules page display
   #panelRules: ingame rules sidepanel display
   #popup.rules: popup with rules extract only */


/* add special fonts if wanted */

/* add styles for headers h1-h5 if needed*/

/* cover picture only in main rules */
#rules .cover {    width: 60%;    margin-left: 20%;}
#panelRules .cover {    display: none;}

.rules .content ul {list-style-type: none;}

/* flex style for responsive display */
.rules .flex { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5em; }
@media (max-width: 768px) {
    .rules .flex.mobile { flex-direction: column; /* columns below each other */  }
}
#panelRules .flex.mobile { flex-direction: column; }
.rules .flex .column {    flex: 1; }
.rules .flex .column.wide {    flex: 2; }


/* example variable flex structure putting flexboxes half their wide on wide screen full rules
.rules  .flex.appendix .flexbox { flex: 2 2 23%;  padding:0.5em; padding-right: 1em;}
.rules  .flex.appendix .flexbox img { height:5em; float: left; margin-right: 1em; }
@media (max-width: 1024px) {
    .rules .flex.appendix .flexbox { flex: 2 2 48%; }
}
#panelRules .flex.appendix .flexbox { flex: 2 2 48%; }
*/


/* Examples */
.rules .example { font-style: italic; } /* put your example style here */
#panelRules .example { display: none; } /* examples should not be shown in sidebar */

/* ==========================================================================
   Torres: Castilian Castle & Parchment Rulebook Theme
   ========================================================================== */

@font-face {
    font-family: 'TorresCinzel';
    src: url('/game-plugins/torres2/1.0.0/fonts/Cinzel-VariableFont_wght.ttf') format('truetype');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TorresCondensed';
    src: url('/game-plugins/torres2/1.0.0/fonts/FiraSansCondensed-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

#rules.torres-rules,
.rules.torres-rules {
    box-sizing: border-box;
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: 34px 36px 44px;
    background: linear-gradient(180deg, #fdfaf2 0%, #f6ecda 100%);
    border: 1.5px solid #cbb489;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(48, 33, 14, 0.11);
    color: #2c2115;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15.5px;
    line-height: 1.68;
    overflow-wrap: anywhere;
}

#rules.torres-rules::before,
.rules.torres-rules::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    border-radius: 13px 13px 0 0;
    background: repeating-linear-gradient(90deg, #8b7b65 0 18px, #dfd2b7 18px 26px);
    border-bottom: 2px solid #6e5f4b;
}

#rules.torres-rules *,
.rules.torres-rules * {
    box-sizing: border-box;
}

.rules.torres-rules img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.rules.torres-rules img.inlineImage {
    height: 1.15em;
    width: auto;
    vertical-align: -2px;
}

/* Cover Banner & Sidebar Title */
#rules.torres-rules .cover {
    width: 100%;
    max-width: 540px;
    margin: 8px auto 26px;
    padding: 18px;
    text-align: center;
    background: radial-gradient(circle at 50% 35%, #5b4730 0%, #2d2217 100%);
    border: 2px solid #c99636;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(42, 28, 12, 0.24), inset 0 1px 0 rgba(255, 236, 179, 0.3);
}

#rules.torres-rules .cover img {
    display: block;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    border-radius: 8px;
    border: 2px solid #e6c677;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.rules.torres-rules .gameTitle {
    font-family: 'TorresCinzel', Georgia, serif;
    font-size: 1.65em;
    font-weight: 700;
    color: #6e1913;
    text-align: center;
    letter-spacing: 0.06em;
    margin: 2px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #cbb07c;
}

/* Table of Contents */
.rules.torres-rules .content {
    background: linear-gradient(180deg, #f5ead2 0%, #ebe0c4 100%);
    border: 1px solid #cdb587;
    border-top: 3px solid #8f1d18;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 0 0 26px;
    box-shadow: 0 3px 10px rgba(56, 38, 14, 0.06);
}

.rules.torres-rules .torres-toc-title {
    font-family: 'TorresCinzel', Georgia, serif;
    font-size: 1.02em;
    font-weight: 700;
    color: #6e1913;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #d4be93;
}

.rules.torres-rules .content ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.rules.torres-rules .content li {
    margin: 3px 0;
    padding: 0;
}

.rules.torres-rules .content a.internal_anchor {
    display: block;
    padding: 5px 10px;
    border-radius: 6px;
    color: #5c1811;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.rules.torres-rules .content a.internal_anchor::before {
    content: "◆";
    color: #b8821e;
    margin-right: 7px;
    font-size: 0.78em;
}

.rules.torres-rules .content a.internal_anchor:hover {
    background: rgba(143, 29, 24, 0.09);
    color: #3d0f0a;
    text-decoration: none;
}

/* Yucata Rule Deviations */
.rules.torres-rules .deviation {
    background: linear-gradient(135deg, #fff6df 0%, #fce8bc 100%);
    border: 1px solid #dba246;
    border-left: 5px solid #b53818;
    border-radius: 10px;
    padding: 15px 18px;
    margin: 12px 0 22px;
    color: #3b2310;
    box-shadow: 0 3px 10px rgba(145, 52, 20, 0.08);
}

.rules.torres-rules .deviation h2 {
    font-family: 'TorresCinzel', Georgia, serif;
    font-size: 1.18em;
    color: #7d220e;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: none;
}

.rules.torres-rules .deviation ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.rules.torres-rules .deviation li {
    margin: 6px 0;
}

.rules.torres-rules span.deviation {
    display: inline;
    background: #feefc4;
    color: #7a220e;
    border: 1px solid #dfa84e;
    border-radius: 4px;
    padding: 1px 6px;
    margin: 0;
    font-weight: 600;
    box-shadow: none;
}

/* Chapters, Subchapters & Headings */
.rules.torres-rules .chapter {
    margin: 0 0 28px;
}

.rules.torres-rules .chapter.subchapter {
    background: #fffdf8;
    border: 1px solid #ded0b1;
    border-top: 3px solid #b9965b;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 0 0 18px;
    box-shadow: 0 2px 8px rgba(48, 33, 14, 0.05);
}

.rules.torres-rules .chapter h1,
.rules.torres-rules .chapter h2 {
    font-family: 'TorresCinzel', Georgia, serif;
    font-size: 1.44em;
    font-weight: 700;
    color: #5c1811;
    text-align: left;
    margin: 0 0 14px;
    padding: 9px 15px;
    background: linear-gradient(90deg, rgba(143, 29, 24, 0.11) 0%, rgba(201, 150, 48, 0.06) 65%, transparent 100%);
    border-left: 5px solid #8f1d18;
    border-bottom: 2px solid #cbb282;
    border-radius: 0 8px 8px 0;
    line-height: 1.3;
}

.rules.torres-rules .deviation h2 {
    background: none;
    border: 0;
    padding: 0;
    margin: 0 0 10px;
    font-size: 1.18em;
    color: #7d220e;
}

.rules.torres-rules h3 {
    font-family: 'TorresCondensed', "Segoe UI", sans-serif;
    font-size: 1.24em;
    font-weight: 700;
    color: #4a2a10;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e4d6b8;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.rules.torres-rules h4 {
    font-family: 'TorresCondensed', "Segoe UI", sans-serif;
    font-size: 1.12em;
    font-weight: 700;
    color: #6e1913;
    margin: 0 0 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.rules.torres-rules .torres-h-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex: none;
}

.rules.torres-rules .torres-ap-pill {
    margin-left: auto;
    font-family: "Segoe UI", Roboto, sans-serif;
    font-size: 0.76em;
    font-weight: 700;
    color: #fff8e8;
    background: linear-gradient(135deg, #8f1d18 0%, #6e1410 100%);
    border: 1px solid #4a0c09;
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.rules.torres-rules p {
    margin: 0 0 12px;
    line-height: 1.68;
}

.rules.torres-rules p:last-child {
    margin-bottom: 0;
}

.rules.torres-rules .chapter ul,
.rules.torres-rules .chapter ol {
    margin: 0 0 14px;
    padding-left: 22px;
    line-height: 1.65;
}

.rules.torres-rules .chapter li {
    margin: 6px 0;
}

.rules.torres-rules .chapter li::marker {
    color: #8f1d18;
    font-weight: 700;
}

.rules.torres-rules .column {
    min-width: 0;
}

/* Thematic Callout, Formula & King's Bonus Tiers */
.rules.torres-rules .torres-callout {
    background: linear-gradient(135deg, #f8f1e2 0%, #f1e4c9 100%);
    border: 1px solid #d5bf95;
    border-left: 4px solid #b8821e;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0 14px;
    color: #362715;
}

.rules.torres-rules .torres-formula {
    background: linear-gradient(135deg, #fdf6e2 0%, #f7e6bd 100%);
    border: 1px solid #d5b268;
    border-left: 5px solid #8f1d18;
    border-radius: 8px;
    padding: 10px 16px;
    margin: 12px 0 14px;
    font-family: 'TorresCinzel', Georgia, serif;
    font-weight: 700;
    color: #5c1811;
    text-align: center;
}

.rules.torres-rules .torres-king-tiers {
    list-style: none;
    padding-left: 0;
    margin: 10px 0 14px;
}

.rules.torres-rules .torres-king-tiers li {
    background: #fbf5e7;
    border: 1px solid #dfcca4;
    border-left: 4px solid #c99636;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 6px 0;
}

/* Phase Block Distribution Card */
.rules.torres-rules .torres-phase-box {
    background: #fffdf8;
    border: 1px solid #ded0b1;
    border-radius: 10px;
    padding: 16px;
    margin: 12px 0 0;
    box-shadow: 0 2px 8px rgba(48, 33, 14, 0.05);
}

.rules.torres-rules .torres-phase-box .flex {
    align-items: center;
    gap: 18px;
}

.rules.torres-rules .torres-phase-art {
    flex: 0 0 170px;
    text-align: center;
}

.rules.torres-rules .torres-phase-art img {
    max-width: 155px;
    border-radius: 6px;
    border: 1px solid #c8b288;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14);
}

.rules.torres-rules .torres-figure-label {
    font-weight: 700;
    color: #5c1811;
    margin-bottom: 8px;
    font-size: 0.96em;
}

.rules.torres-rules .torres-phase-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    background: #fdf9ef;
    border: 1px solid #d5c198;
    border-radius: 6px;
    overflow: hidden;
}

.rules.torres-rules .torres-phase-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e3d3b1;
    vertical-align: top;
}

.rules.torres-rules .torres-phase-table tr:nth-child(even) td {
    background: #f5ebd5;
}

.rules.torres-rules .torres-phase-table tr:last-child td {
    border-bottom: 0;
}

.rules.torres-rules .torres-phase-table td:first-child {
    font-weight: 700;
    color: #5c1811;
    white-space: nowrap;
}

/* Action Summary Card Showcase */
.rules.torres-rules .torres-summary-showcase {
    background: #fffdf8;
    border: 1px solid #ded0b1;
    border-radius: 10px;
    padding: 16px;
    margin: 14px 0;
    box-shadow: 0 2px 8px rgba(48, 33, 14, 0.05);
}

.rules.torres-rules .torres-summary-showcase .flex {
    align-items: center;
    gap: 14px;
}

.rules.torres-rules .torres-summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rules.torres-rules .torres-summary-item {
    background: #f6ebd4;
    border: 1px solid #d3bc8e;
    border-left: 3px solid #8f1d18;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 700;
    color: #3a2610;
    font-size: 0.94em;
    text-align: center;
}

.rules.torres-rules .torres-summary-card {
    text-align: center;
}

.rules.torres-rules .torres-summary-card img {
    max-width: 150px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Examples & Rule Figures */
.rules.torres-rules .example {
    font-style: normal;
    background: #f4ebda;
    border: 1px solid #d5c198;
    border-left: 4px solid #9c7438;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 14px 0 4px;
    color: #362a1b;
}

.rules.torres-rules .torres-rule-figure {
    text-align: center;
    margin: 10px 0;
}

.rules.torres-rules .torres-rule-figure img {
    border-radius: 6px;
    border: 1px solid #cbb68c;
    box-shadow: 0 2px 8px rgba(42, 28, 12, 0.14);
}

.rules.torres-rules .torres-rule-rows > .flex {
    align-items: center;
    gap: 12px;
}

.rules.torres-rules .torres-rule-rows .column:only-child {
    text-align: center;
}

/* Action Cards Gallery */
.rules.torres-rules .torres-card-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.rules.torres-rules .torres-card-entry {
    background: #fffdf8;
    border: 1px solid #d8c39a;
    border-left: 4px solid #8f1d18;
    border-radius: 10px;
    padding: 14px 18px;
    align-items: center;
    gap: 18px;
    box-shadow: 0 2px 8px rgba(48, 33, 14, 0.05);
}

.rules.torres-rules .torres-card-art {
    flex: 0 0 118px;
    text-align: center;
}

.rules.torres-rules .torres-card-art img {
    max-width: 110px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.rules.torres-rules .torres-card-body {
    flex: 1 1 0;
    min-width: 0;
}

/* Responsive Tablet/Mobile & 300px Sidebar */
@media (max-width: 720px) {
    #rules.torres-rules,
    .rules.torres-rules {
        padding: 24px 16px 32px;
        font-size: 14.5px;
    }

    .rules.torres-rules .torres-phase-art,
    .rules.torres-rules .torres-card-art {
        flex: 0 0 auto;
        width: 100%;
    }

    .rules.torres-rules .torres-card-entry {
        align-items: flex-start;
    }
}

#panelRules #rules.torres-rules,
#panelRules .torres-rules {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 18px 10px 22px;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 8px;
    box-shadow: none;
}

#panelRules .torres-rules::before {
    height: 7px;
    border-radius: 7px 7px 0 0;
    background: repeating-linear-gradient(90deg, #8b7b65 0 12px, #dfd2b7 12px 18px);
}

#panelRules .torres-rules .noSidebar,
#panelRules .torres-rules .example {
    display: none !important;
}

#panelRules .torres-rules .flex.mobile {
    flex-direction: column;
    align-items: stretch;
}

#panelRules .torres-rules .content {
    padding: 10px;
    margin-bottom: 16px;
}

#panelRules .torres-rules .content a.internal_anchor {
    padding: 4px 6px;
    font-size: 0.93em;
}

#panelRules .torres-rules .deviation {
    padding: 10px 12px;
    margin-bottom: 16px;
}

#panelRules .torres-rules .chapter {
    margin-bottom: 18px;
}

#panelRules .torres-rules .chapter.subchapter {
    padding: 10px 12px;
    margin-bottom: 12px;
}

#panelRules .torres-rules .chapter h1,
#panelRules .torres-rules .chapter h2 {
    font-size: 1.15em;
    padding: 6px 10px;
    margin-bottom: 10px;
}

#panelRules .torres-rules .deviation h2 {
    padding: 0;
    font-size: 1.08em;
}

#panelRules .torres-rules h3 {
    font-size: 1.05em;
    margin-bottom: 8px;
    padding-bottom: 6px;
}

#panelRules .torres-rules h4 {
    font-size: 1em;
}

#panelRules .torres-rules .torres-h-icon {
    width: 19px;
    height: 19px;
}

#panelRules .torres-rules .torres-ap-pill {
    margin-left: 0;
    white-space: normal;
    padding: 1px 8px;
    font-size: 0.78em;
}

#panelRules .torres-rules .chapter ul,
#panelRules .torres-rules .chapter ol {
    padding-left: 18px;
}

#panelRules .torres-rules .torres-phase-box,
#panelRules .torres-rules .torres-summary-showcase {
    padding: 10px;
}

#panelRules .torres-rules .torres-phase-art,
#panelRules .torres-rules .torres-card-art {
    flex: 0 0 auto;
    width: 100%;
}

#panelRules .torres-rules .torres-phase-art img,
#panelRules .torres-rules .torres-summary-card img {
    max-width: 120px;
}

#panelRules .torres-rules .torres-phase-table td {
    padding: 5px 7px;
    font-size: 0.92em;
}

#panelRules .torres-rules .torres-card-entry {
    padding: 10px 12px;
    gap: 8px;
    align-items: flex-start;
}

#panelRules .torres-rules .torres-card-art img {
    max-width: 96px;
}
