/* 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 */

/* Pulsar rulebook layout: shared by the full page, sidebar and rule extracts. */
.rules {
    line-height: 1.55;
}
.rules p {
    line-height: 1.55;
    margin: .55em 0;
}
.rules li {
    line-height: 1.5;
}
.rules li + li {
    margin-top: .35em;
}
.rules h1, .rules h2, .rules h3, .rules h4 {
    color: inherit;
    line-height: 1.25;
}
.rules h1 {
    margin: .8em 0;
    text-align: left;
}
.rules h2 {
    margin: 1.6em 0 .6em;
    padding-bottom: .3em;
    border-bottom: 1px solid #8794a455;
}
.rules h3 {
    margin: 1.2em 0 .45em;
}
.rules h4 {
    margin: 1em 0 .4em;
}
.rules .chapter {
    display: flow-root;
    margin: 1.5em 0;
}
.rules .rule-anchor {
    display: block;
    height: 0;
}
.rules a[href] {
    text-decoration: underline;
    text-underline-offset: .15em;
}
.rules a[href]:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.rules img {
    max-width: 100%;
    height: auto;
}
.rules .clearBoth {
    clear: both;
}

.rules .content {

    padding: .5em 0 1em;

    border-bottom: 1px solid #8794a455;

}
.rules .content ul {
    padding: 0;
    margin: 0;
}
.rules .content li {
    margin: 0;
}
.rules .content a {
    display: inline-block;
    padding: .22em 0;
}
.rules .flex > .column {
    min-width: 0;
}
.rules .itemisation {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .4em .75em;
}
.rules .itemisation .itemcnt {
    font-weight: bold;
    text-align: right;
}

.rules .inline, .rules .inlineRight {

    display: inline-block;

    vertical-align: middle;

    margin: .5em .75em .5em 0;

}
.rules .picsWithText {
    display: flex;
    align-items: flex-start;
    gap: .8em;
}
.rules .picsWithText > img {
    flex: 0 1 auto;
    max-width: 40%;
    max-height: 16em;
    object-fit: contain;
}
.rules .picsWithText > p {
    flex: 1 1 0;
    min-width: 0;
}
.rules .LeftSideStartingPositions {
    width: 80%;
}
.rules .RightSideStartingPositions {
    width: 18%;
}

.rules table {

    border-collapse: collapse;

    margin: .75em 0;

}
.rules th, .rules td {
    border: 1px solid #8794a477;
    padding: .3em .55em;
}
.rules .stationScores th, .rules .stationScores td {
    text-align: center;
}
.rules .stationScores th {
    background: #8794a416;
}
.rules .stationScores {
    font-size: .9em;
}
.rules .stationScores th, .rules .stationScores td {
    padding: .2em .25em;
}

.rules .iconIndex {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18em), 1fr));

    gap: .65em 1em;

}
.rules .iconIndex > h2, .rules .iconIndex > h3, .rules .iconIndex > a {
    grid-column: 1 / -1;
}
.rules .rule-icon-entry {
    display: flex;
    align-items: flex-start;
    gap: .8em;
    min-width: 0;
}
.rules .rule-icon-entry > img {
    flex: none;
    width: 3.5em;
    max-height: 5em;
    object-fit: contain;
}
.rules .rule-icon-entry > p {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}
.rules .illustratedRules {
    list-style: none;
    padding: 0;
    margin-left: 0;
}
.rules .illustratedRules li {
    display: flex;
    align-items: center;
    gap: .8em;
    padding: .45em 0;
}
.rules .illustratedRules img {
    flex: none;
    width: 3.5em;
    object-fit: contain;
}
.rules .goalTiles img {
    width: 4.5em;
}

.rules .appendix:is(:where([data-gcf-pulsar2849-h2]),:not(*) > .Goal) {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18em), 1fr));

    gap: 1em;

}
.rules .appendix:is(:where([data-gcf-pulsar2849-h2]),:not(*) > .Goal) > h1, .rules .appendix:is(:where([data-gcf-pulsar2849-h2]),:not(*) > .Goal) > h2, .rules .appendix:is(:where([data-gcf-pulsar2849-h2]),:not(*) > .Goal) > a {
    grid-column: 1 / -1;
}
.rules .Goal {
    display: flex;
    align-items: flex-start;
    gap: .8em;
    min-width: 0;
    padding: .5em 0;
}
.rules .Goal > img {
    width: 4.5em;
    flex: none;
}
.rules .Goal > p {
    flex: 1 1 0;
    margin: 0;
    min-width: 0;
}
.rules .GoalSeparator, .rules .appendix > .clearBoth {
    display: none;
}

.rules .TechBoard {

    display: flex;

    align-items: flex-start;

    gap: 1.2em;

    margin: 1em 0;

}
.rules .TechBoard > img {
    width: 32%;
    height: auto;
    flex: none;
}
.rules .TechBoardDetails {
    flex: 1 1 0;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15em), 1fr));
    gap: .75em;
}
.rules .Technology {
    display: flow-root;
    min-width: 0;
    margin: 0;
    padding: .75em;
    border: 1px solid #8794a444;
    border-radius: .3em;
    background: #8794a410;
}
.rules .Technology > img {
    display: block;
    width: 100%;
    max-width: 15em;
    height: auto;
    margin: 0 auto .6em;
}
.rules .Technology.Dummy {
    display: none;
}
.rules .technologyReference .Technology, .rules.technologyReference .Technology {
    margin: .8em 0;
}

#panelRules .chapter {

    margin: 1.1em 0;

    overflow-wrap: break-word;

}
#panelRules h2 {
    margin-top: 1.25em;
}
#panelRules .content .flex {
    gap: 0;
}
#panelRules .picsWithText {
    flex-direction: column;
    gap: .3em;
}
#panelRules .picsWithText > img {
    max-width: 100%;
    max-height: 14em;
}
#panelRules .iconIndex, #panelRules .appendix:is(:where([data-gcf-pulsar2849-h3]),:not(*) > .Goal), #panelRules .TechBoardDetails {
    grid-template-columns: minmax(0, 1fr);
}
#panelRules .TechBoard {
    display: block;
}
#panelRules .TechBoard > img {
    display: none;
}
#panelRules .Technology {
    padding: .6em;
}

@media (max-width: 640px) {
    .rules .TechBoard {
        flex-direction: column;
    }
    .rules .TechBoard > img {
        width: min(100%, 18em);
        align-self: center;
    }
    .rules .TechBoardDetails {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
    }
    .rules .picsWithText {
        flex-direction: column;
    }
    .rules .picsWithText > img {
        max-width: 100%;
    }
}
