/* ============================================================
   Paragon board detail page (partials/paragon-board-view.php, paragon-board-detail.js)
   The board itself comes from the planner (paragon-board.css + game-trees.css); this file only
   frames it in the column and styles the tally and the node list.
   ============================================================ */

/* --- Board section --- */
.pbd__tally {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    list-style: none;
    margin: 0 0 0.9rem;
    padding: 0;
    font-size: 0.85rem;
    color: var(--text-muted, #7a7870);
}

.pbd__tally-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.12s ease;
}

.pbd__tally-item:hover,
.pbd__tally-item:focus-visible,
.pbd__tally-item.is-pinned {
    color: var(--text, #e0ddd5);
}

.pbd__tally-item b {
    color: var(--text, #e0ddd5);
    font-weight: 600;
}

.pbd__tally-item .pbd-medal {
    width: 22px;
    height: 22px;
}

/* ember canvas behind the board like the game's paragon screen, edge to edge in the section */
.pbd__stage {
    margin: 0 -1.5rem;
    padding: 0.75rem 1rem;
    background: #080707 var(--pbd-canvas, none) center / cover no-repeat;
    border-block: 1px solid #17110f;
}

/* database shell: sections have no padding, their children carry side margins (database.css) */
.db-shell .pbd > .pbd__stage {
    margin-left: 0;
    margin-right: 0;
}

.db-shell .pbd > .pbd__bar {
    margin-bottom: 1rem;
}

/* square box at column width (max 1.2 × the board) — reserves the space before the script draws */
.pbd__board {
    position: relative;
    width: 100%;
    max-width: 936px;
    aspect-ratio: 1;
    margin: 0 auto;
}

.pbd__scaler {
    position: absolute;
    left: 0;
    top: 0;
    width: 780px;
    height: 780px;
    transform: scale(var(--pbd-s, 1));
    transform-origin: 0 0;
}

.pbd__frame {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 756px;
    height: 756px;
}

.pbd--v2 .pbd__frame {
    background: var(--pbd-board) 4px 4px / calc(100% - 8px) calc(100% - 8px) no-repeat;
}

.pbd__spin {
    position: absolute;
    inset: 0;
    transform-origin: 50% 50%;
}

.pbd__frame .pb-grid--embedded {
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
}

/* highlight from the list: the marked nodes glow (search layer of the game look), the rest steps back */
.pbd--focus .pbd__frame .pb-grid .pb-node:not(.pb-node--search-match) {
    opacity: 0.32 !important;
}

.pbd--focus .pbd__frame .pb-grid:not(.pgv2) .pb-node--search-match {
    opacity: 1 !important;
}

.pbd--focus .pbd__frame .pb-grid .pb-node.pb-node--search-match {
    z-index: 9;
    animation: pbd-mark 1.6s ease-in-out infinite;
}

@keyframes pbd-mark {
    0%, 100% { filter: drop-shadow(0 0 3px rgba(255, 196, 90, 0.55)); }
    50% { filter: drop-shadow(0 0 10px rgba(255, 196, 90, 0.95)) brightness(1.25); }
}

@media (prefers-reduced-motion: reduce) {
    .pbd--focus .pbd__frame .pb-grid .pb-node.pb-node--search-match {
        animation: none;
        filter: drop-shadow(0 0 8px rgba(255, 196, 90, 0.9));
    }
}

.pbd__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
    margin-top: 0.9rem;
}

.pbd__hints {
    flex: 1 1 320px;
}

.pbd__hint {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted, #7a7870);
}

.pbd--mouse .pbd__hint--touch,
.pbd--touch .pbd__hint--mouse,
.pbd:not(.pbd--mouse):not(.pbd--touch) .pbd__hint--touch {
    display: none;
}

.pbd__rotate {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pbd__rotate[hidden] {
    display: none;
}

.pbd__rot-val {
    min-width: 3.2em;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #c4a24e;   /* --gold is the site's red accent */
}

.pbd__btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(196, 162, 78, 0.35);
    border-radius: 4px;
    background: rgba(196, 162, 78, 0.06);
    color: var(--text, #e0ddd5);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.pbd__btn--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    padding: 0;
}

.pbd__btn:hover,
.pbd__btn:focus-visible {
    border-color: #c4a24e;
    background: rgba(196, 162, 78, 0.14);
}

/* --- Medallion (ring + rarity coin + node symbol, the node card's art) --- */
.pbd-medal {
    position: relative;
    display: inline-block;
    flex: none;
    width: 40px;
    height: 40px;
}

.pbd-medal img,
.pbd-medal__sym {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    display: block;
}

.pbd-medal__sprite.sp-legendary { inset: -13%; width: 126%; height: 126%; }
.pbd-medal__sprite.sp-rare { inset: -7.5%; width: 115%; height: 115%; }
.pbd-medal__sprite.sp-starter { inset: 5%; width: 90%; height: 90%; }

.pbd-medal__sym {
    inset: 25%;
    width: 50%;
    height: 50%;
    background-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* --- Node list --- */
.pbd-nodes__hint {
    margin: -0.25rem 0 1rem;
    font-size: 0.85rem;
    color: var(--text-muted, #7a7870);
}

.pbd-kind + .pbd-kind {
    margin-top: 1.4rem;
}

.pbd-kind__title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.6rem;
    font-family: var(--font-heading, serif);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text, #e0ddd5);
    cursor: pointer;
}

.pbd-kind__title .pbd-medal {
    width: 26px;
    height: 26px;
}

.pbd-kind--legendary .pbd-kind__title { color: #f78005; }
.pbd-kind--rare .pbd-kind__title { color: #eaec0a; }
.pbd-kind--magic .pbd-kind__title { color: #8d8ef7; }

.pbd-kind__count {
    font-family: var(--font-body, sans-serif);
    font-size: 0.85rem;
    color: var(--text-muted, #7a7870);
}

.pbd-kind__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pbd-kind--legendary .pbd-kind__list,
.pbd-kind--rare .pbd-kind__list {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.pbd-kind--legendary .pbd-kind__list {
    grid-template-columns: 1fr;
}

.pbd-node {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(196, 162, 78, 0.12);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.pbd-node:hover,
.pbd-node:focus-visible {
    border-color: rgba(196, 162, 78, 0.45);
    background: rgba(196, 162, 78, 0.05);
    outline: none;
}

.pbd-node.is-pinned {
    border-color: #c4a24e;
    background: rgba(196, 162, 78, 0.09);
}

.pbd-node--legendary { border-color: rgba(247, 128, 5, 0.35); }
.pbd-node--rare { border-color: rgba(234, 236, 10, 0.18); }

.pbd-node__body {
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #c9c2b6;
}

.pbd-node__title {
    font-family: var(--font-heading, serif);
    font-size: 1.02rem;
    line-height: 1.25;
    color: #e9e4da;
    margin-bottom: 0.25rem;
}

.pbd-node--legendary .pbd-node__title { color: #f78005; }
.pbd-node--rare .pbd-node__title { color: #eaec0a; }

.pbd-node__attrs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pbd-node__attrs li + li {
    margin-top: 0.1rem;
}

.pbd-node__desc,
.pbd-node__bonus,
.pbd-node__req,
.pbd-node__note {
    margin: 0.3rem 0 0;
}

.pbd-node__bonus {
    color: #a39c90;
}

.pbd-node__req {
    font-size: 0.85rem;
    color: #a39c90;
}

.pbd-node__req-pos,
.pbd-node__note {
    color: var(--text-muted, #7a7870);
}

.pbd-node__count {
    flex: none;
    align-self: center;
    min-width: 2.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: var(--text-muted, #7a7870);
}

/* game-text colours of the node cards (tooltip-v2.css, scoped there to .d4tt) */
.pbd-nodes .gt { white-space: normal; }
.pbd-nodes .gt-c_number { color: #d9a962; }
.pbd-nodes .gt-c_important { color: #e2ded6; }
.pbd-nodes .gt-c_label { color: #b79e7a; }
.pbd-nodes .gt-mark,
.pbd-nodes .gt-mult { color: #808080; }
.pbd-nodes .gt-u { text-decoration: underline; text-underline-offset: 0.14em; text-decoration-thickness: 1px; }
.pbd-nodes .gt-c_magic { color: #8d8ef7; }
.pbd-nodes .gt-c_rare { color: #eaec0a; }
.pbd-nodes .gt-c_legendary { color: #f78005; }
.pbd-nodes .gt-c_red { color: #ba100d; }
.pbd-nodes .gt-c_green { color: #4fbf5a; }
.pbd-nodes .gt-c_bonusoff,
.pbd-nodes .gt-c_bonuson { color: inherit; }

@media (max-width: 768px) {
    .pbd__stage {
        padding: 0.5rem;
    }

    .pbd-kind--rare .pbd-kind__list,
    .pbd-kind__list {
        grid-template-columns: 1fr;
    }
}
