.theme-rakdos {
    --bg: #221d20;
    --panel: #30292b;
    --ink: #f2efed;
    --muted: #d5bbc0;
    --gold: #f3c969;
    --accent: #df6877;
    --line: #655251;
}

.theme-rabbits {
    --bg: #f3f6f0;
    --panel: #ffffff;
    --ink: #263a30;
    --muted: #566456;
    --gold: #22583d;
    --accent: #b54c3c;
    --line: #bfcdbc;
}

.theme-otters {
    --bg: #f1f5f7;
    --panel: #ffffff;
    --ink: #253842;
    --muted: #516770;
    --gold: #076b76;
    --accent: #b34832;
    --line: #b9cdd4;
}

.theme-forest {
    --bg: #151b13;
    --panel: #212a1e;
    --ink: #eef1e8;
    --muted: #b9c5ac;
    --gold: #e0c97f;
    --accent: #7faa6b;
    --line: #43523c;
}

.theme-sultai {
    --bg: #11191b;
    --panel: #1a2526;
    --ink: #e9f0ee;
    --muted: #a7c0b9;
    --gold: #d4b976;
    --accent: #5d9d8b;
    --line: #37473f;
}

.theme-jund {
    --bg: #1e1530;
    --panel: #2b2044;
    --ink: #efe6ff;
    --muted: #bfa9e6;
    --gold: #b6ff3b;
    --accent: #e0559a;
    --line: #6a55a0;
    --nav-bg: #150e24;
}

.theme-gruul {
    --bg: #16140f;
    --panel: #23201a;
    --ink: #f0ece2;
    --muted: #bfb096;
    --gold: #e0c97f;
    --accent: #c97a4a;
    --line: #453d2c;
}

.theme-temur {
    --bg: #0f1619;
    --panel: #1a2429;
    --ink: #e9f1f1;
    --muted: #9fbfc2;
    --gold: #e0b96f;
    --accent: #4fa3a8;
    --line: #2e454a;
}

* {
    box-sizing: border-box;
}

.guide-page {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
}

.guide-page header {
    padding: 32px max(20px, calc((100% - 1060px) / 2)) 24px;
    border-top: 6px solid var(--accent);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(120deg, var(--panel), var(--bg));
}

.guide-page h1 {
    margin: 0 0 4px;
    color: var(--gold);
    font-size: 2.1rem;
    line-height: 1.2;
}

.guide-page .sub {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
}

.guide-page nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    padding: 8px 20px;
    background: var(--nav-bg, var(--bg));
    border-bottom: 1px solid var(--line);
    font-size: .9rem;
}

.guide-page nav a {
    text-decoration: none;
}

.guide-page nav a:hover {
    text-decoration: underline;
}

.guide-page main {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.guide-page section {
    padding: 26px 0 12px;
    border-bottom: 1px solid var(--line);
}

.guide-page h2 {
    margin: 0 0 14px;
    font-size: 1.45rem;
    color: var(--gold);
}

.guide-page h3 {
    margin: 26px 0 10px;
    font-size: 1.1rem;
}

.guide-page p,
.guide-page li {
    max-width: 78ch;
}

.guide-page li+li {
    margin-top: 10px;
}

.guide-page .strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 160px));
    gap: 16px;
    margin: 22px 0;
}

.guide-page .strip figure {
    margin: 0;
    min-width: 0;
}

.guide-page .strip img {
    width: 100%;
    aspect-ratio: 488 / 680;
    border-radius: 8px;
}

.guide-page figcaption {
    margin-top: 6px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.guide-page .callout {
    margin: 18px 0;
    padding: 8px 0 8px 18px;
    border-left: 3px solid var(--accent);
}

.guide-page table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

.guide-page th,
.guide-page td {
    padding: 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.guide-page th {
    color: var(--gold);
}

.guide-page .grid {
    display: grid;
    gap: 18px;
}

.guide-page .c {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel);
}

.guide-page .c>img {
    display: block;
    width: 100%;
    height: auto;
}

.guide-page .c .body {
    padding: 12px;
    font-size: .9rem;
}

.guide-page .c .nm {
    font-weight: bold;
}

.guide-page .c .ty {
    margin: 6px 0;
    color: var(--muted);
    font-size: .78rem;
}

.guide-page summary {
    padding: 6px 0;
    color: var(--gold);
    cursor: pointer;
}

.guide-page .oracle-text {
    white-space: pre-wrap;
    font-size: .85rem;
}

.guide-page .basic-land {
    display: grid;
    place-items: center;
    aspect-ratio: 488 / 680;
    color: var(--accent);
    font: bold 3rem Georgia, serif;
    background: repeating-linear-gradient(45deg, transparent, transparent 18px, var(--line) 19px, transparent 20px);
}

.guide-page footer {
    max-width: 1100px;
    margin: auto;
    padding: 24px 20px 36px;
    color: var(--muted);
    font-size: .85rem;
}

/* Components ported from the richer guides (blight-curse): hero, info
   boxes, numbered steps, category badges and hover-zoom card images. */
.guide-page .hero {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 24px;
}

.guide-page .hero img {
    width: 280px;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgb(0 0 0 / 55%);
}

.guide-page .box {
    margin: 14px 0;
    padding: 16px 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.guide-page .box.warn {
    border-color: var(--accent);
}

.guide-page .box.tip {
    border-color: var(--gold);
}

.guide-page .steps {
    counter-reset: s;
    list-style: none;
    padding: 0;
}

.guide-page .steps li {
    position: relative;
    padding-left: 52px;
    margin: 14px 0;
}

.guide-page .steps li::before {
    counter-increment: s;
    content: counter(s);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--bg);
    font-weight: bold;
    font-size: 1.1rem;
}

.guide-page .grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 700px) {
    .guide-page .grid-2 {
        grid-template-columns: 1fr;
    }
}

.guide-page .card-img {
    display: block;
    width: 100%;
    border-radius: 8px;
    transition: transform .15s;
}

@media (hover: hover) {
    .guide-page .strip .card-img:hover {
        position: relative;
        z-index: 9;
        transform: scale(1.6);
        box-shadow: 0 8px 30px rgb(0 0 0 / 55%);
    }
}

.guide-page .cost {
    font-family: monospace;
    color: var(--gold);
}

.guide-page .badge {
    display: inline-block;
    margin: 6px 0;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--line);
    color: var(--gold);
    font-size: .72rem;
    text-transform: uppercase;
}

.guide-page .badge.comandante {
    background: #4a3a7a;
    color: #fff;
}

.guide-page .badge.motor {
    background: #7a5a1c;
    color: #fff;
}

.guide-page .badge.finisher {
    background: var(--accent);
    color: #fff;
}

.guide-page .badge.remocion,
.guide-page .badge.remoción {
    background: #5b2a5e;
    color: #fff;
}

.guide-page .badge.proteccion,
.guide-page .badge.defensa {
    background: #2d5a8a;
    color: #fff;
}

.guide-page .badge.mana {
    display: inline-block;
    border-radius: 10px;
    background: #3c6b3c;
    color: #fff;
}

.guide-page .badge.robo {
    background: #1f6f7a;
    color: #fff;
}

.guide-page .badge.truco {
    background: #8a5a2d;
    color: #fff;
}

.guide-page .badge.relleno {
    background: #555;
    color: #ddd;
}

.guide-page .badge.tierra {
    background: #6b5b3c;
    color: #fff;
}

.guide-page .badge.utilidad {
    background: #44607a;
    color: #fff;
}

.guide-page .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.guide-page .legend .badge {
    margin: 0;
}

.guide-page details {
    margin: 8px 0;
}

.theme-jund header {
    padding: 40px 20px 24px;
    border-top: 0;
    border-bottom: 3px solid var(--gold);
    background: linear-gradient(180deg, #6b4fb0, var(--bg));
    text-align: center;
}

@media (max-width: 700px) {
    .guide-page h1 {
        font-size: 1.75rem;
    }

    .guide-page nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        gap: 18px;
    }

    .guide-page .strip {
        gap: 10px;
    }

    .guide-page .hero {
        flex-direction: column;
        align-items: center;
    }

    .guide-page .hero img {
        max-width: 280px;
    }
}
