/* 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 */

/* Moonlit starry sky outer backdrop when Luna rules are displayed */
#rulesPage,
.luna-rules-bg {
    background: #081324 url('images/rules_sky.webp') center top / cover fixed no-repeat;
    border-radius: 0 0 .375rem .375rem;
}

.luna-rules-bg {
    padding: 1.25rem .75rem;
    border-radius: .5rem;
}

#rulesPage .luna-rules-bg,
#panelRules .luna-rules-bg {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* Luna rulebook presentation: comfortable reading measure (~68ch) & high-contrast typography */
.luna-rules {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a242f;
    max-width: 740px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.7;
}

#rules.luna-rules,
#rulesPage .luna-rules {
    background: #ffffff;
    border: 1px solid #b5a365;
    border-radius: 12px;
    padding: 1.8em 2.4em 2.4em;
    box-shadow: 0 14px 40px rgba(4, 10, 20, .5);
}

.luna-rules img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

.luna-rules .column {
    min-width: 0;
}

.luna-rules .gameTitle {
    font-family: Georgia, "Times New Roman", serif;
    color: #163042;
    border-bottom: 2px solid #b5a365;
    padding-bottom: .2em;
    margin-bottom: .75em;
}

/* Override rulesbase.css cramped line-height: normal and tight margins */
.luna-rules p {
    line-height: 1.7;
    margin: 0 0 .95em;
}

.luna-rules p:last-child {
    margin-bottom: 0;
}

.luna-rules ul,
.luna-rules ol {
    line-height: 1.65;
    margin: .4em 0 1.05em 1.2em;
    padding-left: .9em;
}

.luna-rules li {
    margin: .42em 0;
}

/* Table of contents: clean midnight-blue card */
.luna-rules .content {
    background: linear-gradient(135deg, #0b192d 0%, #142d4c 65%, #1b3b62 100%);
    border: 1px solid #b5a365;
    border-radius: 10px;
    padding: 1.05em 1.4em;
    margin: 0 0 1.4em;
    box-shadow: 0 4px 16px rgba(10, 22, 38, .28);
    color: #f4ebd0;
}

.luna-rules .content ul {
    margin: 0;
    padding-left: 0;
}

.luna-rules .content li {
    margin: .28em 0;
}

.luna-rules .content a.internal_anchor {
    font-weight: 600;
    text-decoration: none;
    color: #f5edd6;
    display: inline-block;
    padding: .1em 0;
    transition: color .15s ease, transform .15s ease;
}

.luna-rules .content a.internal_anchor::before {
    content: "▸ ";
    color: #d4ba78;
}

.luna-rules .content a.internal_anchor:hover {
    text-decoration: underline;
    color: #ffe28a;
    transform: translateX(2px);
}

/* Headings */
.luna-rules h1,
.luna-rules h2,
.luna-rules h3,
.luna-rules h4 {
    font-family: Georgia, "Times New Roman", serif;
    color: #163042;
    text-align: left;
    line-height: 1.3;
}

.luna-rules .chapter {
    margin: 2em 0 0;
}

.luna-rules .chapter>h1 {
    font-size: 1.38em;
    font-weight: 700;
    letter-spacing: .02em;
    color: #f7edd0;
    background: linear-gradient(90deg, #0d1f36 0%, #173457 70%, #1e426c 100%);
    border: 1px solid #8f7b44;
    border-bottom: 3px solid #c9af69;
    border-radius: 6px;
    padding: .42em .85em;
    margin: 0 0 .95em;
    box-shadow: 0 3px 10px rgba(10, 22, 38, .18);
}

.luna-rules .chapter>h1::before {
    content: "☾";
    color: #ebd082;
    margin-right: .45em;
    font-weight: 400;
    text-shadow: 0 0 8px rgba(235, 208, 130, .45);
}

.luna-rules .chapter>h1 a {
    color: inherit;
    text-decoration: none;
}

.luna-rules h2 {
    font-size: 1.22em;
    color: #1e425b;
    margin: 1.5em 0 .6em;
}

.luna-rules h3 {
    font-size: 1.08em;
    color: #1e425b;
    margin: 1.35em 0 .55em;
    padding-bottom: .2em;
    border-bottom: 1px solid #d8e1e8;
}

.luna-rules h4 {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.04em;
    font-weight: 700;
    color: #163042;
    margin: 0 0 .45em;
    display: flex;
    align-items: center;
    gap: .5em;
    flex-wrap: wrap;
}

.luna-rules h4 img {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(16, 36, 50, .25);
}

/* Deviations & Callouts */
.luna-rules .deviation {
    border: 1px solid #d9534f;
    border-left: 5px solid #c53030;
    border-radius: 6px;
    padding: .75em 1.05em;
    margin: .9em 0 1.2em;
    background: #fff6f5;
}

.luna-rules span.deviation {
    display: block;
    padding: .45em .85em;
    margin: .45em 0 .1em;
}

.luna-rules .deviation h2 {
    margin: 0 0 .4em;
    font-size: 1.04em;
    color: #9b1c1c;
}

.luna-rules .deviation ul {
    margin: 0 0 0 1.15em;
}

.luna-rules .ln-diary {
    position: relative;
    font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
    font-size: 16px;
    color: #2f2419;
    background-color: #fbf4e3;
    background-image:
        repeating-linear-gradient(180deg, transparent 0, transparent 24px, rgba(160, 134, 88, .18) 24px, rgba(160, 134, 88, .18) 25px, transparent 25px, transparent 28px),
        linear-gradient(180deg, #fcf7ea 0%, #f5e9cf 100%);
    background-origin: content-box, padding-box;
    background-position: 0 0, 0 0;
    border: 1px solid #d4c198;
    border-left: 8px solid #6b4c2b;
    border-radius: 3px 10px 10px 3px;
    padding: 22px 28px 24px 30px;
    margin: .9em 0 1.5em;
    box-shadow: inset 8px 0 16px rgba(107, 76, 43, .08), 0 4px 14px rgba(16, 30, 48, .1);
}

.luna-rules .ln-diary p {
    line-height: 28px;
    margin: 0 0 28px;
}

.luna-rules .ln-diary p:last-child {
    margin-bottom: 0;
}

.luna-rules .ln-diary p:first-child {
    font-size: 16px;
    color: #4a341c;
    box-shadow: inset 0 -1px 0 rgba(160, 134, 88, .35);
    margin-bottom: 28px;
}

.luna-rules .ln-diary p:nth-of-type(2)::first-letter {
    float: left;
    font-size: 2.7em;
    line-height: .85;
    padding: 3px 8px 0 0;
    color: #6b4c2b;
    font-weight: 700;
}

.luna-rules .ln-diary em {
    font-style: normal;
    color: #2f2419;
}

.luna-rules .ln-rule-tip {
    background: #f5f7fa;
    border: 1px solid #dce4ec;
    border-left: 4px solid #1e425b;
    border-radius: 6px;
    padding: 1em 1.25em;
    margin: .85em 0 1.35em;
}

.luna-rules cite.noSidebar {
    display: block;
    margin-top: .5em;
    padding: .3em .75em;
    border-left: 3px solid #b5a365;
    background: #f7f9fb;
    border-radius: 0 4px 4px 0;
    color: #465869;
    font-style: italic;
    font-size: .92em;
}

/* Components & Favor Grids */
.luna-rules .ln-rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: .8em;
    margin: .85em 0 1.3em;
}

.luna-rules .ln-rule-card {
    background: #ffffff;
    border: 1px solid #d5dfe8;
    border-radius: 8px;
    padding: .7em .6em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    gap: .5em;
    box-shadow: 0 2px 6px rgba(16, 36, 50, .06);
}

.luna-rules .ln-rule-imgs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .35em;
    width: 100%;
    min-height: 62px;
    padding: .4em;
    background: radial-gradient(circle, #eef3f7 0%, #e3ebf2 100%);
    border-radius: 6px;
}

.luna-rules .ln-rule-imgs img {
    max-height: 68px;
    width: auto;
    filter: drop-shadow(0 2px 3px rgba(16, 36, 50, .25));
}

.luna-rules .ln-rule-imgs.ln-rule-imgs-lg img {
    max-height: 92px;
}

.luna-rules .ln-rule-caption {
    font-size: .88em;
    line-height: 1.35;
    color: #1f2d3a;
    font-weight: 500;
}

.luna-rules .ln-favor-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .5em;
    margin: .85em 0 1.3em;
}

@media (max-width: 720px) {
    .luna-rules .ln-favor-strip {
        grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    }
}

.luna-rules .ln-favor-item {
    background: #f5f8fb;
    border: 1px solid #d5dfe8;
    border-radius: 8px;
    padding: .55em .35em;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .35em;
    font-size: .84em;
    font-weight: 600;
    line-height: 1.25;
    color: #163042;
}

.luna-rules .ln-favor-item img {
    width: 38px;
    height: 38px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(16, 36, 50, .2);
}

/* Action & Overview Sections */
.luna-rules .ln-action-card {
    padding: .55em 0 1.1em;
    margin: .95em 0;
    border-bottom: 1px solid #e4e9ee;
}

.luna-rules .ln-action-card:last-of-type {
    border-bottom: 0;
}

.luna-rules .ln-overview-grid {
    display: flex;
    flex-direction: column;
    gap: .7em;
    background: #f4f7fa;
    border: 1px solid #d5dfe8;
    border-left: 4px solid #b5a365;
    border-radius: 8px;
    padding: .9em 1.15em;
    margin: .6em 0 1.3em;
}

.luna-rules .ln-overview-card {
    padding-bottom: .6em;
    border-bottom: 1px solid #dde5ed;
}

.luna-rules .ln-overview-card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.luna-rules .ln-overview-card h3 {
    margin: 0 0 .25em;
    padding: 0;
    border: 0;
    font-size: 1.02em;
    color: #163042;
}

.luna-rules .ln-inline-icon {
    height: 1.35em;
    width: auto;
    margin: 0 .15em;
}

/* 300px In-Game Sidebar Refinements */
#panelRules .luna-rules {
    font-size: 13.5px;
    line-height: 1.5;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
}

#panelRules .luna-rules p {
    line-height: 1.5;
    margin-bottom: .6em;
}

#panelRules .luna-rules li {
    line-height: 1.45;
    margin: .25em 0;
}

#panelRules .luna-rules .content {
    padding: .65em .85em;
    margin-bottom: .9em;
    border-radius: 8px;
}

#panelRules .luna-rules .chapter {
    margin: 1.1em 0;
}

#panelRules .luna-rules .chapter>h1 {
    font-size: 1.12em;
    padding: .35em .6em;
    margin: 0 0 .6em;
}

#panelRules .luna-rules .ln-action-card {
    padding: .2em 0 .65em;
    margin: .6em 0;
}

#panelRules .luna-rules h4 img {
    width: 22px;
    height: 22px;
}

#panelRules .luna-rules .ln-favor-strip {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: .35em;
}

#panelRules .luna-rules .ln-favor-item {
    padding: .35em .2em;
    font-size: .78em;
}

#panelRules .luna-rules .ln-favor-item img {
    width: 28px;
    height: 28px;
}

#panelRules .luna-rules .ln-overview-grid {
    padding: .65em .8em;
}