html, body {
    margin: 0;
    height: 100%;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #0b0e13;
    color: #c8cdd4;
}

/* ── site shell + nav ─────────────────────────────────────── */
.site { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    height: 48px;
    flex: 0 0 48px;
    padding: 0 18px;
    background: #0c0f14;
    border-bottom: 1px solid #20262f;
    position: relative;
}
.site-nav .brand { color: #e6c25a; font-weight: 800; letter-spacing: 3px; text-decoration: none; font-size: 17px; }
/* hamburger toggle — hidden on desktop, shown on narrow screens */
.nav-toggle { display: none; margin-left: auto; flex-direction: column; justify-content: center; gap: 4px;
    width: 38px; height: 34px; background: transparent; border: 1px solid #2c333b; border-radius: 6px; cursor: pointer; padding: 0 8px; }
.nav-toggle span { display: block; height: 2px; background: #d6dbe2; border-radius: 2px; transition: transform .15s, opacity .15s; }
.nav-scrim { display: none; }
.site-links { display: flex; gap: 6px; }
.site-links a {
    color: #9aa3ad;
    text-decoration: none;
    font-size: 13.5px;
    padding: 6px 12px;
    border-radius: 4px;
}
.site-links a:hover { color: #d6dbe2; background: #161b22; }
.site-links a.active { color: #f2e3b0; background: #1c2129; }
.nav-wallet {
    margin-left: auto;
    background: #1c222c;
    color: #8b93a0;
    border: 1px solid #2c333b;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12.5px;
}
.site-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.wyrd-top {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 12px 18px;
    background: #12151c;
    border-bottom: 1px solid #20262f;
}

.wyrd-title {
    font-weight: 800;
    letter-spacing: 3px;
    color: #e6c25a;
    font-size: 20px;
}

.wyrd-status { color: #c8cdd4; font-size: 13px; letter-spacing: 0.4px; }

.wyrd-btn {
    background: #1c222c;
    color: #c8b06a;
    border: 1px solid #2c333b;
    border-radius: 4px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
}
.wyrd-btn:hover { background: #242b36; }
.wyrd-btn.ghost { color: #8b93a0; }
.wyrd-top .wyrd-btn { margin-left: auto; }

/* board + side HUD */
.wyrd-main { flex: 1; display: flex; min-height: 0; }

.wyrd-board-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    min-width: 0;
    position: relative;
    overflow: hidden;           /* clip the canvas when it is panned/zoomed past the frame */
}
.wyrd-board {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    cursor: grab;
    touch-action: none;         /* we own pan/pinch; stop the browser from scrolling/zooming the page */
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
    will-change: transform;
}

/* on-screen zoom controls (overlay, bottom-right of the board frame) */
.wyrd-zoom {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}
.wyrd-zoom button {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #2c3441;
    background: rgba(18,21,28,0.82);
    color: #e7ebf1;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.wyrd-zoom button:hover { background: rgba(32,38,47,0.92); }
.wyrd-zoom button:active { transform: translateY(1px); }
.wyrd-zoom .reset { font-size: 13px; }

.wyrd-side {
    width: 320px;
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: #12151c;
    border-left: 1px solid #20262f;
    overflow: hidden;
}
.wyrd-card {
    background: #171b22;
    border: 1px solid #242b34;
    border-radius: 5px;
    padding: 10px;
    font-size: 13px;
    color: #d6dbe2;
    line-height: 1.5;
}

/* hover inspect card */
.wyrd-inspect {
    background: #12161d;
    border: 1px solid #2a323d;
    border-radius: 5px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.wyrd-inspect-head { display: flex; gap: 10px; align-items: center; }
.wyrd-avatar { width: 56px; height: 56px; border-radius: 5px; flex: 0 0 56px; background: #0c0f14; }
.wyrd-name { font-size: 15px; font-weight: 700; color: #f2e3b0; }
.wyrd-muted { font-size: 12px; color: #9aa3ad; }
.wyrd-token { font-size: 12px; color: #8fb0d8; }
.wyrd-price { font-size: 12.5px; font-weight: 700; color: #e6c25a; }
.wyrd-line { font-size: 12.5px; color: #c2c8d0; }
.wyrd-line.muted { color: #a8b0a0; }
.wyrd-line.odds { color: #e6b85a; }
.wyrd-line.small { font-size: 11.5px; color: #b9c0a8; }
.wyrd-sec { font-size: 11px; letter-spacing: 0.5px; color: #c8b06a; margin-top: 3px; }

/* team builder modal */
.wyrd-modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 11, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
}
.b-panel {
    width: min(940px, 96vw);
    max-height: 92vh;
    overflow: auto;
    background: #12151c;
    border: 1px solid #2a323d;
    border-radius: 8px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.b-title { margin: 0; color: #e6c25a; font-size: 20px; letter-spacing: 1px; }
.b-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.b-label { color: #9aa3ad; font-size: 13px; margin-right: 4px; }
.wyrd-btn.sel { border-color: #c8b06a; color: #f2e3b0; background: #2a2618; }

.b-cols { display: flex; gap: 18px; }
.b-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.b-h { color: #c8b06a; font-size: 13px; }
.b-list {
    height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #0e1117;
    border: 1px solid #232a33;
    border-radius: 5px;
    padding: 6px;
}
.b-item {
    text-align: left;
    background: #171b22;
    color: #d6dbe2;
    border: 1px solid #242b34;
    border-radius: 4px;
    padding: 6px 9px;
    font-size: 12.5px;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.b-item:hover { background: #20262f; }
.b-add { color: #c8b06a; font-weight: 700; }
.b-cost { color: #8fb0d8; }
.b-marks { color: #8b93a0; font-size: 11px; margin-left: auto; }
.b-status { font-size: 12.5px; padding: 4px 2px; }
.b-status.ok { color: #6fbf73; }
.b-status.bad { color: #c9a13b; }
.b-bottom { display: flex; gap: 10px; align-items: center; }
.b-start { margin-left: auto; }
.b-start:disabled { opacity: 0.4; cursor: default; }
.wyrd-abilities { display: flex; flex-wrap: wrap; gap: 6px; }
.wyrd-ability {
    background: #1c222c;
    color: #c2c8d0;
    border: 1px solid #2c333b;
    border-radius: 4px;
    padding: 5px 9px;
    font-size: 12px;
    cursor: pointer;
}
.wyrd-ability:hover:not(:disabled) { background: #242b36; }
.wyrd-ability:disabled { opacity: 0.4; cursor: default; }
.wyrd-ability.armed { border-color: #9d6fd0; color: #cbb0ec; }
.wyrd-actions { display: flex; gap: 8px; }

.wyrd-gameover { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 1px; }
.wyrd-gameover .win { color: #6fbf73; }
.wyrd-gameover .lose { color: #c0473a; }

.wyrd-log {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
    color: #9aa3ad;
    line-height: 1.55;
    border-top: 1px solid #20262f;
    padding-top: 8px;
}
.wyrd-log > div:first-child { color: #e6c25a; }

/* ── blazor framework UI (loading + errors) ───────────────── */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #000;
}
    #blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}
    .loading-progress circle {
        fill: none;
        stroke: #2a2f38;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }
        .loading-progress circle:last-child {
            stroke: #e6c25a;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }
.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: #c8cdd4;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
    .loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading Wyrdwars…"); }

/* ── landing ──────────────────────────────────────────────── */
/* kill the browser focus ring on mouse interaction (e.g. clicking the scroll area); keep it for keyboard */
:focus:not(:focus-visible) { outline: none; }
.land:focus, .hero:focus, .hero-title:focus { outline: none; }

.land {
    flex: 1; overflow-y: auto;
    background:
        radial-gradient(70% 48% at 50% -2%, rgba(201,163,74,0.12) 0%, rgba(201,163,74,0) 60%),
        radial-gradient(90% 60% at 50% 6%, #161d29 0%, rgba(11,14,19,0) 62%),
        repeating-linear-gradient(115deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 26px),
        linear-gradient(#0b0e13, #08090d);
}

.hero {
    text-align: center;
    padding: 46px 20px 30px;
}
.hero-eyebrow { color: #9aa3ad; letter-spacing: 5px; font-size: 12px; text-transform: uppercase; margin-bottom: 12px; }
.hero-title {
    font-size: 74px; letter-spacing: 12px; margin: 0; color: #e6c25a; font-weight: 800;
    text-shadow: 0 2px 0 #6b4f15, 0 0 38px rgba(230,194,90,0.30), 0 0 90px rgba(150,42,30,0.20);
}
.hero-rule { width: 130px; height: 2px; margin: 16px auto 6px;
    background: linear-gradient(90deg, transparent, #c9a34a 50%, transparent); }
.hero-tag { max-width: 640px; margin: 14px auto 26px; color: #aeb6c0; font-size: 16.5px; line-height: 1.7; }
.hero-tag strong { color: #e7ebf1; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta {
    text-decoration: none;
    border: 1px solid #2c333b;
    background: #1a202a;
    color: #c8cdd4;
    border-radius: 7px;
    padding: 12px 24px;
    font-size: 15px;
    cursor: pointer;
    transition: background .14s, transform .14s, border-color .14s;
}
.cta:hover { background: #242b36; transform: translateY(-1px); border-color: #3a434f; }
.cta.primary { background: linear-gradient(#d8b24a, #c39a3c); color: #1a1408; border-color: #e0bd57; font-weight: 700;
    box-shadow: 0 6px 22px rgba(201,163,74,0.22); }
.cta.primary:hover { background: linear-gradient(#e4be54, #cda340); }

.warbands { text-align: center; padding: 14px 20px 6px; }
.section-label {
    color: #8b93a0; letter-spacing: 4px; font-size: 11.5px; text-transform: uppercase;
    margin-bottom: 16px; position: relative; display: inline-block; padding: 0 16px;
}
.section-label::before, .section-label::after {
    content: ""; position: absolute; top: 50%; width: 36px; height: 1px; background: #2a323d;
}
.section-label::before { right: 100%; } .section-label::after { left: 100%; }
.hero-faces { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 1000px; margin: 0 auto; }
.hero-faces figure { margin: 0; transition: transform .14s; }
.hero-faces figure:hover { transform: translateY(-3px); }
.hero-faces img { width: 84px; height: 84px; border-radius: 10px; border: 1px solid #2a323d; background: #0c0f14;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4); }
.hero-faces figcaption { font-size: 11px; color: #8b93a0; margin-top: 6px; letter-spacing: .5px; }

.feat { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 40px 20px 28px; max-width: 1100px; margin: 0 auto; }
.feat-card { flex: 1 1 280px; max-width: 340px; background: #12161d; border: 1px solid #232a33; border-radius: 10px;
    padding: 20px; border-top: 2px solid #c9a34a55; transition: border-color .14s, transform .14s; }
.feat-card:hover { transform: translateY(-2px); border-top-color: #c9a34a; }
.feat-card h3 { margin: 0 0 8px; color: #f2e3b0; font-size: 16px; }
.feat-card p { margin: 0; color: #9aa3ad; font-size: 13.5px; line-height: 1.6; }
.feat-card strong { color: #c8cdd4; }
.land-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; padding: 26px 20px 56px; color: #8b93a0; font-size: 13px; }

/* ── marketplace ──────────────────────────────────────────── */
.mkt { flex: 1; overflow-y: auto; padding: 22px 24px 50px; }
.mkt-head h1 { margin: 0 0 6px; color: #e6c25a; letter-spacing: 1px; }
.mkt-sub { max-width: 680px; color: #9aa3ad; font-size: 13.5px; line-height: 1.6; margin: 0 0 12px; }
.mkt-sub strong { color: #d6dbe2; }
.cta.wallet { display: inline-block; opacity: 0.6; }
.mkt-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0 18px; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button {
    background: #161b22; color: #9aa3ad; border: 1px solid #242b34;
    border-radius: 5px; padding: 6px 12px; font-size: 12.5px; cursor: pointer;
}
.seg button:hover { color: #d6dbe2; }
.seg button.on { background: #2a2618; color: #f2e3b0; border-color: #c8b06a; }
.mkt-count { margin-left: auto; color: #8b93a0; font-size: 12.5px; }
.mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.mkt-card {
    background: #12161d; border: 1px solid #242b34; border-radius: 8px;
    padding: 12px; display: flex; flex-direction: column; gap: 4px;
}
.mkt-card { cursor: pointer; transition: border-color .12s, transform .12s; }
.mkt-card:hover { border-color: #3a434f; transform: translateY(-2px); }

.mkt-search {
    background: #12161d; border: 1px solid #2c333b; border-radius: 6px;
    color: #e7ebf1; font-size: 13px; padding: 7px 11px; min-width: 180px;
}
.mkt-search:focus { outline: none; border-color: #50607a; }
.mkt-empty { color: #8b93a0; font-size: 14px; padding: 40px 4px; text-align: center; }
.mkt-art { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #0c0f14; }
.mkt-name { font-weight: 700; color: #f2e3b0; font-size: 14px; margin-top: 4px; }
.mkt-meta { color: #9aa3ad; font-size: 12px; }
.mkt-meta2 { color: #8fb0d8; font-size: 11.5px; }
.mkt-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.mkt-price { color: #e6c25a; font-weight: 700; font-size: 13px; }
.mkt-buy {
    background: #1c222c; color: #6b7480; border: 1px solid #2c333b;
    border-radius: 4px; padding: 4px 12px; font-size: 12px; cursor: not-allowed;
}
.mkt-buy.big { width: 100%; padding: 11px; font-size: 13px; margin-top: 14px; }

/* asset detail modal */
.mkt-overlay {
    position: fixed; inset: 0; z-index: 60; display: flex;
    align-items: center; justify-content: center; padding: 20px;
    background: rgba(6,8,11,0.74); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.mkt-detail {
    position: relative; display: flex; gap: 20px; max-width: 720px; width: 100%;
    max-height: 88vh; overflow-y: auto;
    background: #12161d; border: 1px solid #2a323d; border-radius: 12px; padding: 22px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.6);
}
.mkt-x {
    position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
    border-radius: 6px; border: 1px solid #2c333b; background: #171b22; color: #aab2bd;
    cursor: pointer; font-size: 13px;
}
.mkt-x:hover { background: #20262f; color: #e7ebf1; }
.mkt-detail-art { flex: 0 0 256px; }
.mkt-detail-art img {
    width: 256px; height: 256px; border-radius: 10px; background: #0c0f14;
    border: 1px solid #242b34; object-fit: cover;
}
.mkt-detail-body { flex: 1; min-width: 0; }
.mkt-detail-name { font-size: 22px; font-weight: 800; color: #f2e3b0; letter-spacing: .3px; }
.mkt-detail-sub { color: #9aa3ad; font-size: 12.5px; margin-top: 3px; }
.mkt-detail-price { color: #e6c25a; font-weight: 800; font-size: 18px; margin-top: 8px; }
.mkt-detail-blurb { color: #b9c0c9; font-size: 13px; line-height: 1.55; margin: 10px 0 6px; }
.mkt-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 10px 0; }
.mkt-stat { display: flex; justify-content: space-between; font-size: 12.5px;
    border-bottom: 1px solid #1e242d; padding: 3px 0; }
.mkt-stat span { color: #8b93a0; }
.mkt-stat strong { color: #e7ebf1; }
.mkt-detail-sec { color: #e6c25a; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
    margin: 14px 0 6px; }
.mkt-detail-line { color: #c4cbd4; font-size: 12.5px; padding: 2px 0; }
.mkt-detail-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mkt-chip { background: #1a1f27; border: 1px solid #29313b; border-radius: 999px;
    color: #b9c0c9; font-size: 11.5px; padding: 3px 9px; }

/* ── battle HUD status line (inside the side panel) ──────────── */
.wyrd-status-line {
    background: #10141b; border: 1px solid #222a34; border-radius: 5px;
    padding: 7px 10px; font-size: 12px; color: #aeb6c0; letter-spacing: .3px;
}

/* EDGE dice roll */
.wyrd-edge {
    background: #10141b; border: 1px solid #222a34; border-radius: 6px;
    padding: 8px 10px; display: flex; flex-direction: column; gap: 5px;
}
.wyrd-edge-title { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: #e6c25a; }
.wyrd-edge-row { display: flex; align-items: center; gap: 8px; }
.wyrd-edge-row.lead { color: #f2e3b0; }
.wyrd-edge-who { width: 26px; font-size: 11px; font-weight: 700; color: #9aa3ad; }
.wyrd-edge-row.lead .wyrd-edge-who { color: #e6c25a; }
.wyrd-dice { flex: 1; display: flex; gap: 1px; }
.wyrd-dice .die { font-size: 21px; line-height: 1; color: #d6dbe2; }
.wyrd-edge-row.lead .wyrd-dice .die { color: #f7e9b8; }
.wyrd-edge-res { font-size: 10.5px; color: #8b93a0; white-space: nowrap; }

/* interactive EDGE phase modal */
.edge-modal {
    position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(6,8,11,0.78); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.edge-card {
    width: 100%; max-width: 460px; background: #12161d; border: 1px solid #2a323d; border-radius: 14px;
    padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); text-align: center;
}
.edge-h { color: #e6c25a; font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.edge-sub { color: #9aa3ad; font-size: 12.5px; margin: 4px 0 16px; }
.edge-players { display: flex; gap: 12px; }
.edge-p { flex: 1; background: #0f131a; border: 1px solid #222a34; border-radius: 10px; padding: 12px 10px; }
.edge-p.lead-true { border-color: #e6c25a; box-shadow: 0 0 0 1px #e6c25a inset; }
.edge-p-name { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #9aa3ad; }
.edge-p .edge-dice { display: flex; justify-content: center; gap: 1px; margin: 6px 0; font-size: 24px; color: #e7ebf1; }
.edge-res { font-size: 12px; color: #9aa3ad; }
.edge-res strong { color: #f2e3b0; }
.edge-store { background: #0f131a; border: 1px solid #222a34; border-radius: 10px; padding: 12px; margin-top: 14px; }
.edge-store-h { font-size: 12px; color: #c4cbd4; margin-bottom: 8px; }
.edge-store-h strong { color: #e6c25a; }
.edge-alloc-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 6px 0; }
.edge-alloc-lbl { width: 64px; text-align: right; font-size: 12px; color: #9aa3ad; }
.edge-alloc-val { width: 34px; font-weight: 700; color: #f2e3b0; }
.edge-step {
    width: 30px; height: 30px; border-radius: 7px; border: 1px solid #2c333b; background: #171b22;
    color: #e7ebf1; font-size: 16px; cursor: pointer;
}
.edge-step:disabled { opacity: .4; cursor: default; }
.edge-step:not(:disabled):hover { background: #20262f; }
.edge-first { margin: 16px 0 4px; font-size: 12.5px; color: #8fb0d8; }
.edge-go { width: 100%; margin-top: 8px; }

/* action-point pips */
.wyrd-ap { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #8b93a0; padding: 0 2px; }
.wyrd-ap .ap { width: 13px; height: 13px; border-radius: 50%; border: 1px solid #3a434f; }
.wyrd-ap .ap.on { background: #6cc7b6; border-color: #6cc7b6; box-shadow: 0 0 6px rgba(108,199,182,.5); }
.wyrd-ap .ap.spent { background: #1c222c; }

/* ── campaign ───────────────────────────────────────────────── */
.camp { flex: 1; overflow-y: auto; padding: 26px 24px 60px; }
.camp-loading { color: #8b93a0; }

.camp-new { max-width: 760px; }
.camp-new h1 { color: #e6c25a; letter-spacing: 1px; margin: 0 0 8px; }
.camp-sub { color: #9aa3ad; font-size: 14px; line-height: 1.6; max-width: 640px; margin: 0 0 22px; }
.camp-factions { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-bottom: 24px; }
.camp-faction {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: #12161d; border: 1px solid #242b34; border-radius: 10px; padding: 14px 10px;
    color: #d6dbe2; cursor: pointer; transition: border-color .12s, transform .12s;
}
.camp-faction:hover { transform: translateY(-2px); border-color: #3a434f; }
.camp-faction.sel { border-color: #e6c25a; box-shadow: 0 0 0 1px #e6c25a inset; }
.camp-faction img { width: 84px; height: 84px; border-radius: 8px; background: #0c0f14; }
.camp-faction span { font-weight: 700; font-size: 13px; }

.camp-dash { max-width: 920px; }
.camp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.camp-head h1 { color: #e6c25a; letter-spacing: 1px; margin: 0; }
.camp-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.camp-stat {
    background: #12161d; border: 1px solid #242b34; border-radius: 8px; padding: 8px 14px;
    display: flex; flex-direction: column; min-width: 72px;
}
.camp-stat span { color: #8b93a0; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.camp-stat strong { color: #f2e3b0; font-size: 18px; }

.camp-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 22px 0; }
.camp-fighter { background: #12161d; border: 1px solid #242b34; border-radius: 10px; padding: 12px; text-align: center; }
.camp-fighter img { width: 96px; height: 96px; border-radius: 8px; background: #0c0f14; }
.camp-fighter-name { font-weight: 700; color: #f2e3b0; font-size: 13.5px; margin-top: 6px; }
.camp-fighter-bonus { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 6px; min-height: 20px; }
.camp-fresh { color: #6f7884; font-size: 11.5px; font-style: italic; }
.camp-pip { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 2px 7px; }
.camp-pip.hp { background: #20313a; color: #79d2c4; }
.camp-pip.def { background: #2a2740; color: #b3a7e6; }
.camp-pip.mv { background: #2c3320; color: #c6d97e; }
.camp-pip.xp { background: #312a1c; color: #e6c25a; }

.camp-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.camp-savenote { color: #5f6873; font-size: 11.5px; margin-top: 10px; }

.wyrd-gameover.camp { flex-direction: column; align-items: stretch; gap: 8px; }
.camp-reward { color: #c6cdd6; font-size: 12.5px; }
.camp-go-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── codex (rules / abilities / bestiary) ───────────────────── */
.codex { flex: 1; overflow-y: auto; padding: 0 0 60px; }
.codex-hero {
    text-align: center; padding: 34px 20px 22px;
    background: radial-gradient(120% 90% at 50% -10%, #1c2230 0%, #0d1016 70%);
    border-bottom: 1px solid #20262f;
}
.codex-hero h1 { margin: 0 0 6px; color: #e6c25a; letter-spacing: 3px; font-size: 34px; }
.codex-hero p { color: #9aa3ad; font-size: 14px; max-width: 560px; margin: 0 auto 18px; }
.codex-tabs { display: inline-flex; gap: 6px; background: #12161d; border: 1px solid #242b34; border-radius: 999px; padding: 5px; }
.codex-tabs button {
    border: none; background: transparent; color: #aab2bd; font-size: 13.5px; font-weight: 600;
    padding: 8px 18px; border-radius: 999px; cursor: pointer;
}
.codex-tabs button.on { background: #e6c25a; color: #1a1205; }

/* world / story */
.codex-world { max-width: 980px; margin: 26px auto 0; padding: 0 18px; }
.world-intro {
    color: #c9cfd7; font-size: 15.5px; line-height: 1.85; max-width: 760px; margin: 0 auto 26px;
    text-align: center; font-style: italic;
}
.world-h { text-align: center; color: #e6c25a; letter-spacing: 1px; font-size: 18px; margin: 6px 0 16px; }
.world-factions { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.world-card {
    background: #12161d; border: 1px solid #242b34; border-left: 4px solid #6d6a4e;
    border-radius: 10px; padding: 16px 18px;
}
.world-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.world-card-head h3 { margin: 0; font-size: 18px; letter-spacing: .5px; }
.world-knownas { color: #9aa3ad; font-size: 12.5px; font-style: italic; }
.world-region { color: #e6c25a; font-size: 11.5px; letter-spacing: .5px; margin: 6px 0 2px; }
.world-regiondesc { color: #9aa3ad; font-size: 12.5px; line-height: 1.55; margin: 2px 0 8px; }
.world-blurb { color: #c4cbd4; font-size: 13.5px; line-height: 1.6; margin: 0 0 10px; }
.world-link { color: #8fb0d8; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.world-link:hover { color: #e6c25a; }
.faction-knownas { color: #9aa3ad; font-size: 12.5px; font-style: italic; }
.faction-region { color: #e6c25a; font-size: 11.5px; }

/* rules */
.codex-rules { max-width: 820px; margin: 24px auto; padding: 0 18px; display: flex; flex-direction: column; gap: 12px; }
.rule-card { display: flex; gap: 16px; background: #12161d; border: 1px solid #242b34; border-radius: 12px; padding: 16px 18px; }
.rule-icon { font-size: 30px; line-height: 1; width: 44px; text-align: center; color: #e6c25a; flex: 0 0 44px; }
.rule-body h3 { margin: 0 0 5px; color: #f2e3b0; font-size: 16px; }
.rule-body p { margin: 0; color: #b9c0c9; font-size: 13.5px; line-height: 1.65; }
.rule-body strong { color: #e7ebf1; }

/* filters */
.codex-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 1100px; margin: 22px auto 6px; padding: 0 18px; }
.chip {
    border: 1px solid #2a323d; background: #12161d; color: #aab2bd; font-size: 12.5px;
    padding: 6px 13px; border-radius: 999px; cursor: pointer;
}
.chip.on { background: #e6c25a; color: #1a1205; border-color: #e6c25a; font-weight: 700; }
.codex-search { margin-left: auto; background: #12161d; border: 1px solid #2c333b; border-radius: 6px; color: #e7ebf1; font-size: 13px; padding: 7px 11px; min-width: 170px; }
.codex-search:focus { outline: none; border-color: #50607a; }
.codex-count { color: #8b93a0; font-size: 12px; }
.codex-empty { text-align: center; color: #8b93a0; padding: 40px; }

/* grids */
.codex-grid { max-width: 1100px; margin: 14px auto 0; padding: 0 18px; display: grid; gap: 12px; }
.codex-grid.abilities { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.codex-grid.fighters { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }

.ability-card { background: #12161d; border: 1px solid #242b34; border-radius: 10px; padding: 13px; cursor: pointer; transition: border-color .12s, transform .12s; }
.ability-card:hover { border-color: #3a434f; transform: translateY(-2px); }
.ability-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ability-name { font-weight: 700; color: #f2e3b0; font-size: 14.5px; }
.ability-cost { color: #e6c25a; font-size: 12px; white-space: nowrap; }
.ability-cat { display: inline-block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin: 6px 0; background: #1a1f27; color: #9aa3ad; }
.ability-desc { color: #b9c0c9; font-size: 12.5px; line-height: 1.5; margin: 4px 0 6px; }
.ability-meta { color: #7d8590; font-size: 11px; }
/* faction accents */
.cat-imperials { background: #2a3550; color: #9ab4e6; }
.cat-hexenjaegers { background: #2c2733; color: #c2a7e6; }
.cat-vestals { background: #33302a; color: #e6d6a7; }
.cat-corvus { background: #2a2f33; color: #a7c2c8; }
.cat-erebus { background: #2c3320; color: #bcd87e; }
.cat-undead { background: #25323a; color: #8fcabf; }
.cat-allies { background: #312a1c; color: #e6c25a; }

/* bestiary */
.codex-bestiary { max-width: 1100px; margin: 16px auto 0; padding: 0 18px; }
.bestiary-faction { margin-bottom: 30px; }
.faction-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid #20262f; padding-bottom: 6px; }
.faction-head h2 { margin: 0; color: #e6c25a; letter-spacing: 1px; }
.faction-count { color: #8b93a0; font-size: 12px; }
.faction-blurb { color: #9aa3ad; font-size: 13px; line-height: 1.6; margin: 8px 0 14px; max-width: 700px; }
.fighter-card { background: #12161d; border: 1px solid #242b34; border-radius: 10px; padding: 12px; text-align: center; cursor: pointer; transition: border-color .12s, transform .12s; }
.fighter-card:hover { border-color: #3a434f; transform: translateY(-2px); }
.fighter-card img { width: 100%; max-width: 112px; aspect-ratio: 1; border-radius: 8px; background: #0c0f14; }
.fighter-name { font-weight: 700; color: #f2e3b0; font-size: 13.5px; margin-top: 6px; }
.fighter-stats { color: #8fb0d8; font-size: 11.5px; }

/* codex detail modal */
.codex-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6,8,11,0.76); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.codex-detail { position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; background: #12161d; border: 1px solid #2a323d; border-radius: 12px; padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); }
.codex-detail h2 { margin: 6px 0 12px; color: #f2e3b0; }
.codex-x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 6px; border: 1px solid #2c333b; background: #171b22; color: #aab2bd; cursor: pointer; }
.codex-x:hover { background: #20262f; color: #e7ebf1; }
.detail-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.detail-stats.wide { gap: 8px; }
.detail-stat { background: #0f131a; border: 1px solid #222a34; border-radius: 8px; padding: 7px 12px; display: flex; flex-direction: column; min-width: 70px; }
.detail-stat span { color: #8b93a0; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; }
.detail-stat strong { color: #f2e3b0; font-size: 15px; }
.detail-desc { color: #c4cbd4; font-size: 13.5px; line-height: 1.6; }
.detail-sec { color: #e6c25a; font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; margin: 14px 0 6px; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-static { background: #1a1f27; border: 1px solid #29313b; border-radius: 999px; color: #b9c0c9; font-size: 11.5px; padding: 3px 9px; }
.fighter-detail-head { display: flex; gap: 14px; align-items: center; }
.fighter-detail-head img { width: 96px; height: 96px; border-radius: 10px; background: #0c0f14; border: 1px solid #242b34; }
.fighter-detail-sub { color: #9aa3ad; font-size: 12.5px; margin: 2px 0 6px; }

/* ── responsive: tablet + phone ───────────────────────────── */
@media (max-width: 820px) {
    .site-nav { gap: 10px; padding: 0 12px; }
    .site-nav .brand { font-size: 15px; letter-spacing: 2px; }

    /* collapse the nav into a hamburger dropdown on mobile + tablet */
    .nav-toggle { display: flex; }
    .nav-wallet { display: none; }
    .site-links {
        display: none;
        position: absolute; top: 48px; left: 0; right: 0; z-index: 50;
        flex-direction: column; gap: 2px;
        background: #0c0f14; border-bottom: 1px solid #20262f; padding: 8px;
        box-shadow: 0 14px 30px rgba(0,0,0,0.5);
    }
    .site-links.open { display: flex; }
    .site-links a { padding: 12px 14px; font-size: 15px; border-radius: 6px; }
    .nav-scrim { display: block; position: fixed; inset: 48px 0 0 0; z-index: 40; background: rgba(6,8,11,0.4); }

    /* play: stack the board over the HUD */
    .wyrd-top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
    .wyrd-status { font-size: 12px; }
    .wyrd-main { flex-direction: column; }
    .wyrd-board-wrap { flex: 0 0 auto; padding: 8px; }
    .wyrd-board { max-height: 52vh; }
    .wyrd-side {
        width: auto;
        flex: 1 1 auto;
        border-left: none;
        border-top: 1px solid #20262f;
        overflow-y: auto;
    }

    /* landing */
    .hero { padding: 30px 16px 20px; }
    .hero-title { font-size: 44px; letter-spacing: 5px; }
    .hero-tag { font-size: 14.5px; }
    .hero-faces img { width: 64px; height: 64px; }
    .feat { padding: 28px 16px 20px; }

    /* campaign */
    .camp { padding: 18px 14px 50px; }
    .camp-head { gap: 10px; }
    .camp-roster { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
    .camp-actions { flex-direction: column; align-items: stretch; }

    /* marketplace */
    .mkt { padding: 16px 14px 40px; }
    .mkt-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
    .mkt-search { flex: 1 1 100%; order: 3; }
    .mkt-detail { flex-direction: column; gap: 14px; padding: 18px; align-items: center; }
    .mkt-detail-art { flex: 0 0 auto; }
    .mkt-detail-art img { width: min(72vw, 256px); height: min(72vw, 256px); }
    .mkt-detail-body { width: 100%; }
    .mkt-stats { grid-template-columns: 1fr; }

    /* team builder modal: stack pool + roster */
    .b-cols { flex-direction: column; gap: 12px; }
    .b-list { height: 200px; }
    .b-panel { padding: 14px; }
    .b-title { font-size: 18px; }
}

@media (max-width: 480px) {
    .site-nav { gap: 8px; }
    /* keep the hamburger dropdown links comfortably tappable on small phones */
    .site-links a { padding: 12px 14px; font-size: 15px; }
    .hero-title { font-size: 32px; letter-spacing: 3px; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .wyrd-side { font-size: 13px; }
    .mkt-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
    .mkt-name { font-size: 13px; }
}
