/* 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 */

/* =========================================================
   5 Towers — Rulebook Presentation (base & sidebar safe)
   ========================================================= */

.rules {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    color: #162636;
    line-height: 1.54;
    max-width: 920px;
    margin: 0 auto;
    padding: 18px 20px 24px;
    border-radius: 14px;
    background: linear-gradient(180deg, #7cbcd9 0%, #a5d5eb 45%, #c5e7f5 100%);
    box-sizing: border-box;
    box-shadow: 0 4px 18px rgba(15, 38, 58, 0.14);
}

#panelRules.rules,
#panelRules .rules {
    padding: 8px;
    border-radius: 8px;
    box-shadow: none;
    line-height: 1.44;
    font-size: 0.94em;
}

.rules *,
.rules *::before,
.rules *::after {
    box-sizing: border-box;
}

.rules p {
    line-height: 1.54;
    margin: 0.45em 0;
}

.rules ul,
.rules ol {
    margin: 0.35em 0 0.7em 0.3em;
    padding-left: 1.25em;
    line-height: 1.5;
}

.rules li + li {
    margin-top: 0.3em;
}

#rules .cover {
    width: min(320px, 78%);
    margin: 0 auto 14px;
}

#rules .cover img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 8px 22px rgba(15, 38, 58, 0.28);
}

#panelRules .gameTitle {
    background: #28435c;
    color: #ffffff;
    font-size: 1.35em;
    font-weight: 800;
    padding: 0.35em 0.7em;
    border-radius: 8px;
    margin: 0 0 8px;
    text-align: center;
    letter-spacing: 0.02em;
}

/* Table of Contents */
.rules .content {
    background: rgba(240, 249, 255, 0.88);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 0 14px;
    box-shadow: 0 2px 8px rgba(15, 38, 58, 0.08);
}

.rules .content ul {
    margin: 0;
    padding-left: 0;
}

.rules .content ul ul {
    padding-left: 1.1em;
    margin-top: 0.2em;
}

.rules .content a[href] {
    color: #1d3347;
    font-weight: 600;
    text-decoration: none;
}

.rules .content a[href]:hover {
    color: #0284c7;
    text-decoration: underline;
}

.rules .flex .column {
    min-width: 0;
}

#panelRules .content {
    padding: 8px 10px;
    margin-bottom: 10px;
}

/* Light Icy-Blue Chapter Panels with Slanted Gold Header Ribbon */
.rules .chapter {
    margin: 14px 0;
}

.rules .ft-panel {
    background: #e1f1fa;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 12px 18px 14px;
    box-shadow: 0 3px 10px rgba(15, 38, 58, 0.12);
}

.rules .ft-panel > h1 {
    display: inline-block;
    text-align: left;
    color: #1d3347;
    font-size: 1.32em;
    font-weight: 800;
    line-height: 1.2;
    margin: -2px 0 0.6em -6px;
    padding: 0.3em 2.2em 0.3em 0.85em;
    background: linear-gradient(90deg, #e7b86f 0%, #f1ca89 100%);
    border-radius: 8px 0 0 8px;
    border-bottom: 2px solid #ffffff;
    clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
    max-width: 100%;
}

.rules .ft-panel > h1 a,
.rules .ft-dark-panel > h1 a {
    color: inherit;
    text-decoration: none;
}

#panelRules .ft-panel {
    padding: 9px 10px 11px;
    margin: 10px 0;
}

#panelRules .ft-panel > h1 {
    display: block;
    margin: 0 0 0.5em 0;
    padding: 0.28em 0.65em;
    clip-path: none;
    border-radius: 6px;
    font-size: 1.12em;
}

/* Goal Layout + 7-Card Stacked Demo Tower */
.rules .ft-goal-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.rules .ft-goal-text {
    flex: 1 1 0;
    min-width: 0;
}

.rules .ft-demo-tower {
    position: relative;
    flex: 0 0 66px;
    width: 66px;
    height: 350px;
    background: rgba(255, 255, 255, 0.52);
    border: 2px solid #28435c;
    border-radius: 10px;
    padding: 4px;
}

.rules .ft-demo-tower img {
    position: absolute;
    left: 4px;
    bottom: calc(4px + var(--step, 0) * 42px);
    width: 54px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(15, 38, 58, 0.26);
    z-index: calc(var(--step, 0) + 1);
}

@media (max-width: 600px) {
    .rules .ft-goal-layout {
        flex-direction: column;
        align-items: flex-start;
    }

    .rules .ft-demo-tower {
        align-self: center;
    }
}

/* Dark Slate-Navy Cards Showcase Panel */
.rules .ft-dark-panel {
    background: #28435c;
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    padding: 14px 18px 16px;
    box-shadow: 0 4px 14px rgba(15, 38, 58, 0.22);
}

.rules .ft-dark-panel > h1 {
    text-align: left;
    color: #ffffff;
    font-size: 1.28em;
    font-weight: 800;
    margin: 0 0 0.25em;
}

.rules .ft-tower-showcase {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 12px 10px;
    margin: 14px 0 12px;
}

.rules .ft-tower-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 96px;
}

.rules .ft-fan-pair {
    position: relative;
    width: 96px;
    height: 92px;
    margin-bottom: 6px;
}

.rules .ft-fan-pair img {
    position: absolute;
    width: 54px;
    height: auto;
    border-radius: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.rules .ft-fan-pair .card-zero {
    left: 2px;
    top: 4px;
    transform: rotate(-7deg);
    z-index: 1;
}

.rules .ft-fan-pair .card-fifteen {
    right: 2px;
    top: 6px;
    transform: rotate(5deg);
    z-index: 2;
}

.rules .ft-tower-title {
    font-style: italic;
    font-weight: 700;
    font-size: 0.96em;
    line-height: 1.2;
}

.rules .ft-tower-color {
    font-style: italic;
    font-size: 0.84em;
    color: #cfe4f5;
    line-height: 1.2;
}

.rules .ft-dup-numbers {
    font-size: 1.24em;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff6db;
}

/* Special Cards (0, 8, 9) Callouts */
.rules .ft-special-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0.65em 0 0.25em;
}

.rules .ft-special-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(40, 67, 92, 0.16);
    border-radius: 9px;
    padding: 8px 10px;
}

.rules .ft-special-row img {
    flex: 0 0 auto;
    width: 48px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(15, 38, 58, 0.22);
}

.rules .ft-special-row div {
    flex: 1 1 0;
    min-width: 0;
}

#panelRules .ft-special-row {
    gap: 8px;
    padding: 6px 8px;
}

#panelRules .ft-special-row img {
    width: 34px;
}

/* Subchapters & Phases */
.rules .chapter.subchapter {
    margin: 10px 0;
}

.rules .ft-phase {
    background: rgba(255, 255, 255, 0.66);
    border-left: 4px solid #28435c;
    border-radius: 0 9px 9px 0;
    padding: 8px 12px;
}

.rules .ft-phase > h2 {
    color: #28435c;
    font-size: 1.12em;
    font-weight: 800;
    margin: 0 0 0.3em;
}

.rules .ft-phase > h2 a {
    color: inherit;
    text-decoration: none;
}

#panelRules .ft-phase {
    padding: 6px 8px;
}

/* Scoring Table & Example Callouts */
.rules .ft-rules-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.65em 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.94em;
    box-shadow: 0 1px 4px rgba(15, 38, 58, 0.08);
}

.rules .ft-rules-table th,
.rules .ft-rules-table td {
    border: 1px solid #bfd8ea;
    padding: 0.42em 0.6em;
    text-align: left;
    vertical-align: top;
}

.rules .ft-rules-table th {
    background: #28435c;
    color: #ffffff;
    font-weight: 700;
}

.rules .ft-rules-table tbody tr:nth-child(even) {
    background: #f2f9fd;
}

#panelRules .ft-rules-table {
    font-size: 0.88em;
}

#panelRules .ft-rules-table th,
#panelRules .ft-rules-table td {
    padding: 0.3em 0.45em;
}

.rules .example {
    font-style: italic;
    background: #fff9ea;
    border-left: 4px solid #e7b86f;
    border-radius: 0 8px 8px 0;
    padding: 0.6em 0.85em;
    margin: 0.7em 0;
    color: #362712;
}

/* Great Powers Variant Cards */
.rules .ft-powers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0.6em 0 0.2em;
}

.rules .ft-power-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(40, 67, 92, 0.16);
    border-radius: 9px;
    padding: 8px 10px;
}

.rules .ft-power-thumbs {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
}

.rules .ft-power-thumbs img {
    width: 44px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(15, 38, 58, 0.22);
}

.rules .ft-power-body {
    flex: 1 1 0;
    min-width: 0;
}

#panelRules .ft-power-card {
    gap: 8px;
    padding: 6px 8px;
}

#panelRules .ft-power-thumbs {
    flex-direction: column;
}

#panelRules .ft-power-thumbs img {
    width: 34px;
}

@media (max-width: 520px) {
    .rules {
        padding: 10px;
        border-radius: 10px;
    }

    .rules .ft-panel,
    .rules .ft-dark-panel {
        padding: 10px 12px 12px;
    }

    .rules .ft-panel > h1 {
        font-size: 1.18em;
        margin-left: 0;
        padding: 0.28em 1.4em 0.28em 0.7em;
    }
}
