/* 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 */

@font-face {
    font-family: 'Museo';
    font-weight: 700;
    src: local('Museo'), url('/game-plugins/anachrony/1.2.30/fonts/Museo700-Regular.otf') format('opentype');
}

.rules {
    --anapurple: #843473;
    --researchblue: #404073;
}

.rules :is(p, ol, ul, li) {
    line-height: 1.5em;
}

.rules :is(.chapter .title, h3, h4, h5, h6) {
    color: var(--anapurple);
}

.rules h6 {
    margin-top: 1em;
}

.rules h6.cleanup {
    color: black;
}

.rules .chapter {
    text-align: justify;
}

.rules img.inline {
    height: 1.5em;
    width: auto;
}

.rules .contents ul {
    font-weight: bold;

    ul {
        font-weight: normal;
        font-size: .9rem;
    }
}

.rules .chapter .title {
    text-align: center;
    border: 0;
    margin-top: .1em;
    font-size: 1.5em;
}

.rules .chapter .title::after, .bartriangles::before, .bartriangles::after, .bartriangles > * {
    content: '';
    width: 0;
    height: 0;
    border: 4px solid transparent;
}

.rules .chapter .title::after {
    display: block;
    margin-inline: auto;
    width: min(190px, 42%);
    border-top-color: var(--anapurple);
    border-bottom: 0;
    margin-top: .2em;
}

.bartriangles {
    margin: auto;
    display: flex;
    justify-content: center;
}

.bartriangles::before, .bartriangles::after {
    width: min(200px, 42%);
    margin-inline: -5px;
}

.bartriangles .tridown {
    border-top-color: var(--anapurple);
    border-bottom: 0;
}

.bartriangles .triup, .bartriangles::before, .bartriangles::after {
    border-bottom-color: var(--anapurple);
    border-top: 0;
}

.rules .itemcnt {
    font-weight: bold;
    color: var(--anapurple);
}

.rules .subcat {
    font-weight: bold;
}

.rules li {
    margin-block: .25em;
    position: relative;
}

.rules li::marker {
    font-weight: bold;
}

.rules .phases {
    counter-reset: num;
}

.rules .phases .itemcnt {
    counter-increment: num;
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
}

.rules .phases img.ph {
    height: 1.5em;
    width: auto;
    margin-block: auto;
    position: absolute;
    left: 16%;
}

.rules .phases .trileft {
    width: 0;
    height: 0;
    border: .75em solid transparent;
    border-right: .45em solid var(--anapurple);
    border-left: 0;
}

.rules .phases .itemcnt::after {
    content: counter(num);
    color: white;
    background: var(--anapurple);
    font-family: Museo, serif;
    position: relative;
    padding-right: .15em;
    font-size: 1.2rem;
    line-height: 1.5rem;
}

.rules .action {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-top: .75em;

    img {
        height: 70px;
        width: auto;
    }
}

.rules .imp img {
    height: 2em;
    margin-inline: .5em;
}

.rules .appendix {
    text-wrap: pretty;
}

.rules .ap-icon {
    float: left;
    width: 3em;
    margin-right: .5em;
}
.rules .ap-icon.bld {
    margin-block: .25em;
}

.rules .appendix .paragraph {
    border: 1px solid var(--bs-secondary-border-subtle);
    margin: 0;
    padding: .5rem;
    width: 100%;
    height: 100%;
    text-align: justify;
}

.rules .paragraph p:last-child {
    margin-bottom: 0;
}

.rules .pflex {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.rules .left {
    width: 8em;
    float: left;
    clear: left;
}

.rules .right {
    float: right;
}

.rules .ability {
    height: 3em;
    overflow: hidden;
    margin-right: .5rem;
}

.rules .left .leader {
    position: relative;
    bottom: 8.4em;
}

.rules .gcard {
    width: 8em;
    border-radius: 5px;
    border: 1px solid;
}

.rules .gcard.sh {
    box-shadow: 4px 4px 7px 2px darkgray;
}

.rules .tile {
    width: 8em;
}

.rules .pboard {
    overflow: hidden;
    position: relative;
    min-width: fit-content;
}
.rules .pboard .board {
    width: 255%;
    max-width: 255%;
    height: 8em;
    object-fit: cover;
    object-position: bottom;
}

.rules .chapter .appendix:last-child {
    margin-bottom: 0;
}

.rules .pathtitle {
    display: flex;
    align-items: center;
    margin-block: .5rem;
}

.rules .hints4Handling {
    padding-bottom: 0;
    ul:last-child {
        margin-bottom: 0;
    }
}

.rules .banner {
    width: 50%;
}

.rules .arrow {
    stroke-width: 4;
    stroke: black;
}

.rules .arrow.anap {
    stroke: var(--anapurple);
}

.rules .center {
    display: block;
    margin: .25rem auto;
    max-width: 100%;
}

.rules .mw800 {
    max-width: min(800px, 100%);
}

.rules .mw600 {
    max-width: min(600px, 100%);
}

.rules .mw350 {
    max-width: 350px;
}

.rules .mw225 {
    max-width: 225px;
}

.rules .mw100 {
    max-width: 100px;
}

.rules .withOverlay text {
    font-size: 18px;
    font-style: italic;
}

.rules .inset.withOverlay text {
    font-size: 36px;
}

.rules .dshadow {
    filter: drop-shadow(5px 5px 3px #444);
}

.rules .withOverlay circle.res {
    fill: var(--researchblue);
}

.rules text.pslash {
    fill: var(--anapurple);
    font-size: 2.5rem;
    font-style: normal;
    font-weight: bold;
}

.rules .withOverlay g.nstep circle {
    fill: var(--anapurple);
    stroke: white;
    stroke-width: 4;
    filter: drop-shadow(5px 3px 3px gray);
}
.rules .withOverlay :is(g.nstep text, text.num) {
    fill: white;
    font-size: 24px;
    font-style: normal;
    font-weight: bold;
    font-family: Museo, sans-serif;
}

.rules .withOverlay text.num.black {
    fill: black;
}

.rules .inset {
    position: relative;
    display: inline-block;
    margin: 1%;
}

.rules .inset.left {
    margin-right: 8px;
}
.rules .inset.right {
    margin-left: 8px;
}

.rules .altgrid {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: 100px auto;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    align-items: center;
}

.deviation, .important, .note, .reminder {
    border-radius: 3px;
    padding: .5em;
    margin-block: .5em;
    border: 1px solid;
}

.deviation {
    background-color: #ffffe0;
    border-color: gold;
    .btitle {
        font-weight: bold;
        color: goldenrod;
    }
}

.important {
    background-color: #ffcccc;
    border-color: red;

    .btitle {
        font-weight: bold;
        color: red;
    }
}

.note {
    background-color: #ccffcc;
    border-color: green;

    .btitle {
        font-weight: bold;
        color: green;
    }
}

.reminder {
    background-color: #ccffff;

    .btitle {
        font-weight: bold;
        color: dodgerblue;
    }
}

.effname {
    font-style: italic;
}

.asymname {
    font-weight: bold;
}

.diff {
    text-decoration: underline;
}

.fs-7 {
    font-size: .875rem !important;
}

#panelRules {
    container-type: inline-size;
}

#panelRules .showrules {
    display: none;
}

#rulesContainer .chapter .title, #panelRules .chapter .title {
    color: var(--anapurple);
    background-color: inherit;
    padding-left: 0;
}

#panelRules h5 {
    font-family: var(--bs-body-font-family);
}

#panelRules .chapter:not(#Appendix, #Hints), #panelRules #Appendix>p {
    padding-inline: 3px;
}

/* @container rules to override bs @media rules
    that don't work with the side panel */
@container (max-width: 991px) {
    #panelRules .row > * {
        flex-shrink: 0;
        width: 100%;
    }
}

@container (min-width: 992px) {
    #panelRules .row-cols-lg-4 > * {
        flex: 0 0 auto;
        width: 25%;
    }

    #panelRules .row-cols-lg-3 > * {
        flex: 0 0 auto;
        width: 33.33333333%;
    }
}

@container (min-width: 576px) {
    #panelRules .col-sm {
        flex: 1 0 0;
    }

    #panelRules .row-cols-sm-2 > * {
        flex: 0 0 auto;
        width: 50%;
    }
}

@container (min-width: 768px) {
    #panelRules .row-cols-md-2 > * {
        flex: 0 0 auto;
        width: 50%;
    }
    #panelRules .col-md {
        flex: 1 0 0;
    }
}