.codex{--card-accent:#d3a951;--class-accent:#888;width:min(1280px,94%);margin:18px auto 70px;color:#ede8df;font:14px/1.6 inherit}
.codex *{box-sizing:border-box}.codex a{text-decoration:none}.codex-breadcrumb{display:flex;gap:12px;align-items:center;color:#a9a9a9;margin-bottom:18px}.codex-breadcrumb a{color:#e1c283}
.codex-hero{position:relative;border:1px solid #52504a;border-top:3px solid var(--card-accent);border-radius:16px;overflow:hidden;background:radial-gradient(ellipse at 85% 20%,color-mix(in srgb,var(--card-accent) 24%,transparent),transparent 50%),linear-gradient(135deg,#262626,#141414 72%);padding:clamp(22px,4vw,45px);box-shadow:0 16px 35px #0006}
.codex-hero:before{content:"";position:absolute;inset:0 0 auto;height:3px;background:linear-gradient(90deg,var(--class-accent),var(--card-accent));pointer-events:none}
.codex-topline,.codex-hero-main{position:relative;z-index:1}.codex-topline{display:flex;justify-content:space-between;gap:12px;align-items:center}.codex-eyebrow,.codex-kicker{font-size:10px;letter-spacing:2px;color:var(--card-accent);font-weight:900}.codex-status{font-size:10px;letter-spacing:1px;font-weight:800;color:#b0e3bb;background:#1b3527;border:1px solid #3c7b50;padding:4px 10px;border-radius:99px}
.codex-hero-main{display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,335px);gap:clamp(25px,5vw,65px);align-items:center;margin-top:17px}.codex h1{font-weight:900;font-size:clamp(37px,5vw,68px);line-height:1.05;color:#fff0d0;letter-spacing:-1.2px;margin:8px 0}.codex-subtitle{font-size:17px;color:#cbc2b1;margin:0 0 22px;font-style:italic}.codex-tags{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0}.codex-tag{padding:5px 11px;border-radius:5px;font-size:11px;font-weight:800;letter-spacing:.5px;border:1px solid color-mix(in srgb,var(--card-accent) 65%,transparent);background:color-mix(in srgb,var(--card-accent) 13%,#171717);color:#f8eee1}.codex-class{border-color:color-mix(in srgb,var(--class-accent) 75%,transparent)}
.codex-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;max-width:560px;margin:27px 0}.codex-stats>div{background:#17191bcc;border:1px solid #414141;border-radius:9px;padding:12px 8px;text-align:center}.codex-stats span{display:block;color:#bdb9b0;font-size:11px}.codex-stats strong{display:block;color:#ffedc4;font-size:26px;line-height:1.3}.codex-jump,.codex-browse{color:#f0cc84;font-weight:800}.codex-jump:hover,.codex-browse:hover{color:white}.codex-art-wrap{display:flex;flex-direction:column;align-items:center;gap:8px}.codex-art-button{border:1px solid #6b6455;border-radius:12px;background:#161616;padding:8px;max-width:300px;width:100%;cursor:zoom-in;box-shadow:0 16px 40px #0008;transition:transform .2s,border-color .2s}.codex-art-button:hover{transform:translateY(-5px) rotate(-1deg);border-color:var(--card-accent)}.codex-art-button img{display:block;width:100%;height:auto;border-radius:7px}.codex-art-hint{font-size:11px;color:#aaa}.codex-no-art{border:1px dashed #666;padding:50px 15px;text-align:center;color:#aaa}
.codex-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,340px);align-items:start;gap:22px;margin-top:22px}.codex-primary,.codex-sidebar{display:grid;gap:22px;min-width:0}.codex-panel{background:linear-gradient(160deg,#202122,#171717);border:1px solid #424242;border-radius:13px;padding:clamp(17px,3vw,28px);box-shadow:0 8px 24px #0003;min-width:0}.codex-section-head{display:flex;gap:12px;align-items:center;margin-bottom:18px}.codex-section-icon{flex:0 0 42px;width:42px;height:42px;display:grid;place-items:center;border-radius:9px;border:1px solid color-mix(in srgb,var(--card-accent) 48%,#333);background:color-mix(in srgb,var(--card-accent) 11%,#1c1c1c);color:var(--card-accent);font-size:23px}.codex-section-head h2{font-size:22px;font-weight:850;color:#f8e4b5;margin:2px 0}.codex-abilities{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:18px}.codex-abilities span{color:#f1d49e;background:#32291d;border:1px solid #705b3e;border-radius:6px;padding:3px 8px;font-size:11px}.codex-card-text{white-space:pre-line;font-size:15px;line-height:1.9;color:#e3e0db}.codex-constraint{padding:15px;background:#29241b;border-left:3px solid var(--card-accent);border-radius:4px}.codex-constraint strong{color:#f2d394}.codex-constraint p{white-space:pre-line;margin:6px 0 0}.codex-note{color:#bdbdbd;margin:0 0 16px}.codex-versions{display:grid;gap:15px}.codex-version{display:flex;gap:17px;border:1px solid #3b3b3b;background:#242424;padding:12px;border-radius:9px;align-items:flex-start}.codex-version-preview{width:100px;flex:0 0 100px;border:1px solid #555;background:transparent;padding:0;cursor:zoom-in;border-radius:5px;overflow:hidden}.codex-version-preview img{width:100%;display:block}.codex-version strong{display:block;color:#e5d0a4}.codex-version small{display:block;color:#aaa}.codex-archived{display:inline-block;font-size:10px;font-weight:800;color:#e9b0a8;margin:8px 0}.codex-history-text{font-size:12px;line-height:1.55;white-space:pre-line;color:#bebebe;margin:4px 0}
.codex-count{font-size:12px;color:#c0c0c0;font-weight:500;margin-left:5px}.codex-comment-form{display:grid;gap:9px;margin:20px 0 25px}.codex-comment-form label{color:#f3dfa8;font-weight:800}.codex-comment-form textarea{width:100%;background:#131516;border:1px solid #575757;border-radius:9px;padding:14px;color:white;resize:vertical;font:inherit}.codex-comment-form textarea:focus{outline:2px solid var(--card-accent);outline-offset:1px}.codex-form-footer{display:flex;align-items:center;justify-content:space-between;gap:10px}.codex-form-footer span{font-size:11px;color:#999}.codex-form-footer button{border:0;border-radius:7px;background:var(--card-accent);color:#111;padding:10px 18px;font-weight:850;cursor:pointer}.codex-flash{border:1px solid #d8a65a;padding:10px;border-radius:6px;margin-bottom:10px}.codex-signin{border:1px solid #605338;background:#2a251b;padding:16px;border-radius:8px}.codex-signin a{color:#f8db9b}.codex-comments{display:grid;gap:0}.codex-comment{display:flex;gap:12px;padding:19px 0;border-bottom:1px solid #383838}.codex-comment-avatar{width:36px;height:36px;flex:0 0 36px;display:grid;place-items:center;background:color-mix(in srgb,var(--card-accent) 25%,#222);color:#ffefd2;border:1px solid #575048;border-radius:50%;font-weight:900}.codex-comment-body{flex:1;min-width:0}.codex-comment-meta{display:flex;align-items:center;flex-wrap:wrap;gap:9px}.codex-comment-meta strong{color:#f1e4c8}.codex-comment-meta time{font-size:11px;color:#999}.codex-comment-body p{white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0;color:#ddd}.codex-remove{border:0;background:none;padding:0;color:#d6a1a1;text-decoration:underline;cursor:pointer;font-size:11px}.codex-empty{color:#999;margin:14px 0}.codex-deck-list{display:grid;gap:8px;max-height:540px;overflow:auto}.codex-deck{display:grid;gap:3px;padding:12px;border:1px solid #444;border-radius:8px;background:#242424;color:#e8e2d6;transition:border-color .2s,background .2s}.codex-deck:hover{background:#302c26;border-color:var(--card-accent);color:#fff}.codex-deck strong{font-size:13px}.codex-deck small{color:#bbb}.codex-deck span{font-size:11px;font-weight:800;color:var(--card-accent)}.codex-browse{display:block;margin-top:18px}.codex-identity dl{display:grid;grid-template-columns:110px 1fr;gap:12px 5px;margin:15px 0 0}.codex-identity dt{color:#a7a7a7;font-size:12px}.codex-identity dd{color:#ddd;font-size:12px;overflow-wrap:anywhere;margin:0}

@media(max-width:900px){.codex-layout{grid-template-columns:1fr}.codex-hero-main{grid-template-columns:minmax(0,1fr) minmax(190px,245px);gap:25px}}@media(max-width:650px){.codex{width:calc(100% - 24px);margin:15px auto 50px}.codex-hero-main{grid-template-columns:1fr}.codex-art-wrap{grid-row:1}.codex-art-button{max-width:240px}.codex-topline{flex-wrap:wrap}.codex h1{font-size:36px}.codex-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.codex-stats>div{padding:8px 3px}.codex-stats strong{font-size:22px}.codex-stats span{font-size:10px}.codex-version-preview{width:80px;flex-basis:80px}.codex-panel{padding:18px}}
@media(prefers-reduced-motion:reduce){.codex-art-button,.codex-deck{transition:none}.codex-art-button:hover{transform:none}}
/* Shared card viewer shortcut, positioned immediately beside close X */
.codex-viewer-link{position:absolute;top:0;right:52px;z-index:3;width:42px;height:42px;display:grid;place-items:center;border:1px solid #777;border-radius:8px;background:#242424;color:white;cursor:pointer}.codex-viewer-link[hidden]{display:none!important}.codex-viewer-link:hover{border-color:#d3a951;background:#393127}.codex-viewer-link img{width:21px;height:21px;display:block;filter:invert(1)}
.tot-rules-card-lightbox .codex-viewer-link{right:72px;top:clamp(12px,3vw,30px)}
@media(max-width:600px){.tp-gallery-dialog .codex-viewer-link{right:54px;top:0}.tot-rules-card-lightbox .codex-viewer-link{right:68px;top:12px}}

.codex-patches{display:grid;gap:9px}.codex-patch{display:grid;gap:3px;padding:13px 15px;background:#272521;border:1px solid #534832;border-radius:9px;color:#f4dfac}.codex-patch:hover{border-color:var(--card-accent);color:#fff}.codex-patch small{color:#aaa}.codex-patch span{font-size:12px;color:#ccc}



/* ==========================================
   CARD CODEX — PROFILE-STYLE DECK TILES
   ========================================== */

.codex-deck-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    max-height: 700px;
    overflow-y: auto;
    overflow-x: hidden;
}

.codex-deck-tile {
    display: block;
    min-width: 0;
    overflow: hidden;
    background: #171717;
    border: 1px solid #66532f;
    border-radius: 12px;
    color: #f8e4b5;
    text-decoration: none !important;
    transition: transform .14s, border-color .14s, box-shadow .14s;
}

.codex-deck-tile:hover {
    transform: translateY(-3px);
    border-color: #d3a951;
    box-shadow: 0 8px 24px #0007;
    color: #f8e4b5;
}

.codex-deck-title {
    display: block;
    padding: 12px 14px 9px;
    font-size: 17px;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
    color: #f8e4b5;
    overflow-wrap: anywhere;
    border-bottom: 1px solid #3d3d3d;
}

.codex-deck-cover {
    position: relative;
    display: block;
    width: calc(100% - 24px);
    aspect-ratio: 3.33 / 1;
    margin: 10px 12px 8px;
    overflow: hidden;
    border-radius: 8px;
    background: #121212;
}

.codex-deck-cover > img {
    position: absolute;
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    top: -100%;
    left: 0;
    object-fit: unset;
    transform: scaleX(1.25);
}

/* Two display cards — same diagonal arrangement as Profiles */

.codex-deck-cover-dual {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.codex-deck-cover-half {
    display: block;
    position: relative;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.codex-deck-cover-half:first-child {
    clip-path: polygon(0 0, 100% 0, 97% 100%, 0 100%);
    margin-right: -4px;
    z-index: 2;
}

.codex-deck-cover-half:last-child {
    clip-path: polygon(3% 0, 100% 0, 100% 100%, 0 100%);
    margin-left: -4px;
    z-index: 1;
}

.codex-deck-cover-dual img {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center 32%;
}

.codex-deck-cover-left {
    transform: translateX(20%) scale(1.72);
}

.codex-deck-cover-right {
    transform: translateX(-20%) scale(1.72);
}

.codex-deck-cover-dual::after {
    content: "";
    position: absolute;
    top: -10%;
    left: 50%;
    width: 12px;
    height: 125%;
    background: #111;
    transform: translateX(-50%) rotate(8deg);
    transform-origin: center;
    z-index: 5;
    pointer-events: none;
}

.codex-deck-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 5px 13px 12px;
    font-size: 11px;
    color: #bbb;
}

.codex-deck-meta span:last-child {
    flex-shrink: 0;
    font-weight: 800;
    color: #d3a951;
}

.codex-deck-no-cover {
    display: grid;
    place-items: center;
    height: 100%;
    color: #888;
    font-size: 12px;
}



/* ==========================================
   CARD CODEX — ARTWORK FACES
   ========================================== */

.codex-face-selector {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    width: 100%;
    margin-top: 10px;
}

.codex-face-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 70px;
    padding: 5px;
    background: #1b1b1b;
    color: #c9c9c9;
    border: 1px solid #4a4a4a;
    border-radius: 7px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.codex-face-option img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    border-radius: 3px;
}

.codex-face-option span {
    font-size: 11px;
    font-weight: 750;
}

.codex-face-option:hover {
    border-color: var(--card-accent);
    background: #302a21;
}

.codex-face-option.is-active {
    border: 2px solid var(--card-accent);
    color: #f8e4b5;
}

.codex-face-option:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* ==========================================
   CARD CODEX — WORKS WELL TOGETHER
   ========================================== */

.codex-synergy-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.codex-synergy-card {
    display: block;
    min-width: 0;
    padding: 9px;
    background: #181818;
    border: 1px solid #484848;
    border-radius: 9px;
    text-decoration: none !important;
    color: #f8e4b5;
    transition: transform .15s, border-color .15s;
}

.codex-synergy-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-accent);
    color: #fff0c9;
}

.codex-synergy-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
}

.codex-synergy-name {
    display: block;
    padding: 9px 3px 2px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
}

@media (max-width: 650px) {
    .codex-synergy-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .codex-face-option {
        width: 62px;
    }
}


/* ==========================================
   CARD CODEX — ABILITIES INSIDE HERO
   ========================================== */

.codex-hero-abilities {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid
        color-mix(in srgb, var(--card-accent) 35%, #333);
}

.codex-hero-abilities-heading {
    margin-bottom: 14px;
}

.codex-hero-abilities-heading h2 {
    color: #f8e4b5;
    font-size: 21px;
    font-weight: 800;
    margin: 5px 0 0;
}

.codex-hero-abilities .codex-abilities {
    margin: 12px 0 16px;
}

.codex-hero-abilities .codex-card-text {
    color: #e3e0db;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Keep long card abilities comfortably readable */
.codex-hero-abilities p {
    margin-bottom: 12px;
}

/* Give the text more room on narrower screens */
@media (min-width: 651px) and (max-width: 1000px) {
    .codex-hero-main {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(190px, 270px);
        gap: 25px;
    }
}

@media (max-width: 650px) {
    .codex-hero-abilities {
        margin-top: 20px;
        padding-top: 18px;
    }
}

/* ==========================================
   CODEX GALLERY — ARTWORK AND TOP CONTROLS
   ========================================== */

.codex-lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: fit-content;
    height: auto;
    max-width: calc(100vw - 110px);
    max-height: calc(100dvh - 90px);
}

#codexLightboxImage {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(82dvh, 760px);
    object-fit: contain;
    border-radius: 9px;
    box-shadow: 0 20px 60px rgba(0,0,0,.8);
}

/* List icon and X share the same positioning */
.codex-lightbox-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 20;

    display: flex;
    align-items: center;
    gap: 8px;
}

.codex-lightbox-card-link,
.codex-lightbox-controls .codex-lightbox-close {
    position: relative;
    inset: auto;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 38px;
    width: 38px;
    height: 38px;

    margin: 0;
    padding: 0;

    border: 1px solid #d3a951;
    border-radius: 9px;

    background: rgba(10, 14, 21, .92);
    color: #f8dc9e;

    text-decoration: none;
    cursor: pointer;
    line-height: 1;

    transition: background .15s, color .15s;
}

.codex-lightbox-card-link img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;

    filter: brightness(0) saturate(100%)
        invert(86%) sepia(25%) saturate(692%)
        hue-rotate(346deg) brightness(101%) contrast(94%);
}

.codex-lightbox-controls .codex-lightbox-close {
    font-size: 28px;
}

.codex-lightbox-card-link:hover,
.codex-lightbox-controls .codex-lightbox-close:hover {
    background: #d3a951;
    color: #111;
}

.codex-lightbox-card-link:hover img {
    filter: brightness(0);
}

.codex-lightbox-card-link:focus-visible,
.codex-lightbox-controls .codex-lightbox-close:focus-visible {
    outline: 2px solid white;
    outline-offset: 3px;
}

@media (max-width: 650px) {
    .codex-lightbox-stage {
        width: fit-content;
        height: auto;
        max-width: calc(100vw - 76px);
    }

    #codexLightboxImage {
        max-height: 75dvh;
    }

    .codex-lightbox-controls {
        top: 5px;
        right: 5px;
        gap: 5px;
    }

    .codex-lightbox-card-link,
    .codex-lightbox-controls .codex-lightbox-close {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .codex-lightbox-controls .codex-lightbox-close {
        font-size: 25px;
    }
}


/* WWT cards behave as clickable preview tiles */
.codex-synergy-card {
    width: 100%;
    font: inherit;
    text-align: inherit;
    cursor: zoom-in;
}

.codex-synergy-card:focus-visible {
    outline: 2px solid var(--card-accent);
    outline-offset: 3px;
}




/* Official Terragos class colors */

.codex {
    --battleship-color: #0c56ea;
    --aircraft-color: #32ffc8;
    --ironclad-color: #828282;
    --submarine-color: #c00df1;
    --structure-color: #339933;
}


/* Multi-identity Codex page theming */

.codex-hero {
    border-top: 3px solid transparent;

    background:
        radial-gradient(
            ellipse at 15% 15%,
            color-mix(in srgb, var(--identity-1) 22%, transparent),
            transparent 55%
        ),
        radial-gradient(
            ellipse at 85% 20%,
            color-mix(in srgb, var(--identity-2) 25%, transparent),
            transparent 55%
        ),
        radial-gradient(
            ellipse at 35% 95%,
            color-mix(in srgb, var(--identity-3) 14%, transparent),
            transparent 60%
        ),
        linear-gradient(135deg, #222, #141414);

    border-image: none;
}

/* Multicolor hero top edge */

.codex-hero::before {
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--identity-1),
        var(--identity-2),
        var(--identity-3),
        var(--identity-4)
    );
}

/* Bring the card's colors into the other panels */

.codex-panel {
    background:
        radial-gradient(
            ellipse at top right,
            color-mix(in srgb, var(--identity-2) 9%, transparent),
            transparent 65%
        ),
        linear-gradient(160deg, #202122, #171717);
}


/* ==========================================
   CARD CODEX — MULTI-IDENTITY PAGE THEME
   ========================================== */

/* Each badge uses its own actual class/faction color */

.codex .codex-tags .codex-tag {
    border-color: var(--tag-color);
    background: color-mix(
        in srgb,
        var(--tag-color) 17%,
        #171717
    );
    color: #f8eee1;
}

/* The hero blends all four identity colors */

.codex .codex-hero {
    border-top-color: transparent;

    background:
        radial-gradient(
            ellipse at 7% 10%,
            color-mix(in srgb, var(--identity-1) 22%, transparent),
            transparent 54%
        ),
        radial-gradient(
            ellipse at 93% 12%,
            color-mix(in srgb, var(--identity-2) 24%, transparent),
            transparent 56%
        ),
        radial-gradient(
            ellipse at 18% 95%,
            color-mix(in srgb, var(--identity-3) 14%, transparent),
            transparent 55%
        ),
        radial-gradient(
            ellipse at 88% 90%,
            color-mix(in srgb, var(--identity-4) 13%, transparent),
            transparent 55%
        ),
        linear-gradient(135deg, #242424, #121212);
}

/* Multicolor upper edge */

.codex .codex-hero::before {
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--identity-1) 0%,
        var(--identity-2) 33%,
        var(--identity-3) 66%,
        var(--identity-4) 100%
    );
}

/* Main heading keeps the bright, readable gold */

.codex .codex-hero h1 {
    color: #fff0d0;
}

/* Stats incorporate the different identities */

.codex .codex-stats > div:nth-child(4n + 1) {
    border-top: 2px solid var(--identity-1);
}

.codex .codex-stats > div:nth-child(4n + 2) {
    border-top: 2px solid var(--identity-2);
}

.codex .codex-stats > div:nth-child(4n + 3) {
    border-top: 2px solid var(--identity-3);
}

.codex .codex-stats > div:nth-child(4n + 4) {
    border-top: 2px solid var(--identity-4);
}

/* Subtle colored divider inside the abilities area */

.codex .codex-hero-abilities {
    border-top: 1px solid transparent;
    border-image: linear-gradient(
        90deg,
        var(--identity-1),
        var(--identity-2),
        transparent
    ) 1;
}

/* Main artwork frame */

.codex .codex-art-button {
    border-color: color-mix(
        in srgb,
        var(--identity-2) 60%,
        #555
    );
}

/* Gallery thumbnails respond to the identity */

.codex .codex-face-option.is-active {
    border-color: var(--identity-1);
}


/* ==========================================
   CARD CODEX — UNIFIED LOWER PAGE THEME
   Uses the FIRST CLASS color exclusively
   ========================================== */

/* All panels below the hero use the first class */
.codex .codex-layout .codex-panel {
    border: 1px solid color-mix(
        in srgb,
        var(--identity-1) 42%,
        #424242
    );

    border-top: 2px solid var(--identity-1);

    background:
        radial-gradient(
            ellipse at top left,
            color-mix(
                in srgb,
                var(--identity-1) 12%,
                transparent
            ),
            transparent 65%
        ),
        linear-gradient(160deg, #202122, #171717);
}

/* All section icons use the first class */
.codex .codex-layout .codex-section-icon {
    color: var(--identity-1);

    border-color: color-mix(
        in srgb,
        var(--identity-1) 65%,
        #333
    );

    background: color-mix(
        in srgb,
        var(--identity-1) 12%,
        #1c1c1c
    );
}

/* All section kicker labels match */
.codex .codex-layout .codex-kicker {
    color: var(--identity-1);
}

/* Links and actionable elements */
.codex .codex-layout .codex-browse,
.codex .codex-layout .codex-deck-meta span:last-child {
    color: var(--identity-1);
}

/* Comment submit button */
.codex .codex-comment-form button[type="submit"] {
    background: var(--identity-1);
    color: #fff;
}

/* Deck tile hover */
.codex .codex-deck-tile:hover,
.codex .codex-synergy-card:hover {
    border-color: var(--identity-1);
}

/* Card identity accent */
.codex .codex-identity dt {
    color: color-mix(
        in srgb,
        var(--identity-1) 60%,
        #ddd
    );
}

.codex-section-icon-image img {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
}

/* Make the svg inherit the section color styling visually */
.codex-section-icon-image img {
    filter: brightness(0) saturate(100%) invert(74%) sepia(81%) saturate(471%)
            hue-rotate(357deg) brightness(101%) contrast(92%);
}

.codex-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--identity-1);
}

.codex-section-icon-mask {
    width: 18px;
    height: 18px;
    display: block;
    background-color: currentColor;

    -webkit-mask-image: var(--icon-url);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;

    mask-image: var(--icon-url);
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}