/*==================================================
    Fish Fish - Fishing Rod and Ascension
    The Fishing Rod tree's grid of nodes,
    the Ascension tiers, and the Shop card that points
    at them.
==================================================*/

[data-icon="rod"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 21 20 3'/><path d='M20 3v11'/><path d='M20 14a2.5 2.5 0 1 1-2.5 2.5'/><circle cx='8' cy='16.5' r='2'/></svg>"); }
[data-icon="ascend"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 12 6-6 6 6'/><path d='m6 19 6-6 6 6'/><path d='M12 2v1'/></svg>"); }

.rd-modal {
    width: min(1180px, 100%);
}

.rd-modal .book-header {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.rd-modal .book-header > div:first-child {
    flex: 1 1 260px;
    min-width: 0;
}

.rd-tabs button.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.16);
}

.rd-tabs em {
    background: #facc15;
    color: #422006;
}

.rd-body svg:not(.rd-lines),
.rd-modal .dk-wallet svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.rd-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.05);
    font-weight: 800;
    white-space: nowrap;
}

.rd-body button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}


/* Fishing Rod tree */
.rd-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 12px;
}

.rd-bar p {
    flex: 1 1 340px;
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.rd-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rd-refund {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(250, 204, 21, 0.5);
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(250, 204, 21, 0.1);
}

.rd-refund > div {
    flex: 1 1 320px;
}

.rd-refund p {
    margin: 4px 0 0;
    font-size: 0.86rem;
}

.rd-refund b {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.rd-parts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.rd-part {
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid color-mix(in srgb, var(--branch) 45%, var(--line));
    border-radius: var(--ff-r-lg, 12px);
    background: linear-gradient(180deg, color-mix(in srgb, var(--branch) 14%, transparent), transparent);
}

.rd-part header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rd-part h3 {
    margin: 0;
    color: var(--branch);
    font-size: 0.95rem;
}

.rd-part header b {
    padding: 1px 8px;
    border-radius: var(--ff-r-pill, 999px);
    background: color-mix(in srgb, var(--branch) 22%, transparent);
    font-size: 0.78rem;
    white-space: nowrap;
}

.rd-part p {
    margin: 2px 0 4px;
    color: var(--muted);
    font-size: 0.76rem;
}

.rd-part strong {
    display: block;
    font-size: 0.8rem;
}

/* The tree keeps its shape on narrow screens and scrolls sideways. */
.rd-tree-scroll {
    overflow-x: auto;
    padding-bottom: 4px;
}

.rd-graph {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    grid-template-rows: repeat(var(--rows), 124px);
    min-width: 760px;
    max-width: 1040px;
    margin-inline: auto;
}

.rd-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.rd-lines line {
    stroke: var(--line);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.rd-lines line.lit {
    stroke: var(--branch);
    stroke-width: 3;
}

.rd-node-tag {
    color: var(--branch);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rd-node.perk {
    border-style: dashed;
    border-radius: var(--ff-r-lg, 18px);
}

.rd-node.perk.owned {
    border-style: solid;
}

.rd-node {
    position: relative;
    z-index: 1;
    align-self: center;
    display: flex !important;
    flex-direction: column;
    gap: 2px !important;
    min-width: 0;
    margin: 5px 3px;
    padding: 6px 5px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 10px);
    background: var(--panel, #10233a);
    color: var(--text);
    font: inherit;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
}

.rd-node strong {
    max-width: 100%;
    font-size: 0.74rem;
    overflow-wrap: anywhere;
}

.rd-node small {
    color: var(--muted);
    font-size: 0.66rem;
}

.rd-node-cost {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 800;
}

.rd-node-cost.done {
    color: var(--branch);
}

.rd-node.owned {
    border-color: var(--branch);
    background: color-mix(in srgb, var(--branch) 24%, var(--panel, #10233a));
}

.rd-node.owned small {
    color: var(--text);
}

.rd-node.ready {
    border-color: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25);
}

.rd-node.ready:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.4);
}

.rd-node.short .rd-node-cost {
    color: #fca5a5;
}

.rd-node.locked {
    opacity: 0.5;
    cursor: default;
}

.rd-node {
    border-top: 3px solid color-mix(in srgb, var(--branch) 70%, var(--line));
}


/* Ascension */
.rd-asc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 12px 14px;
    border: 1px solid rgba(250, 204, 21, 0.45);
    border-radius: var(--ff-r-lg, 14px);
    background: linear-gradient(120deg, rgba(250, 204, 21, 0.14), rgba(168, 85, 247, 0.12));
}

.rd-asc-points {
    display: grid;
    justify-items: center;
    min-width: 96px;
}

.rd-asc-points b {
    color: #fde047;
    font-size: 2rem;
    line-height: 1;
}

.rd-asc-points span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.rd-asc-progress {
    flex: 1 1 260px;
    min-width: 0;
}

.rd-asc-progress p {
    margin: 0 0 6px;
    font-weight: 700;
}

.rd-asc-progress small {
    color: var(--muted);
}

.rd-asc-bar {
    height: 8px;
    margin-bottom: 4px;
    overflow: hidden;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.1);
}

.rd-asc-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #facc15, #a855f7);
}

.rd-asc-intro {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.rd-asc-total {
    margin: 10px 0 0;
    font-size: 0.86rem;
    font-weight: 700;
}

.rd-asc-total span {
    margin-right: 8px;
    color: #fde047;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rd-tier {
    margin-top: 14px;
}

.rd-tier header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin-bottom: 8px;
}

.rd-tier h3 {
    margin: 0;
    font-size: 1rem;
}

.rd-tier header span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.rd-tier.locked .rd-tier-nodes {
    opacity: 0.5;
}

.rd-tier-nodes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
}

.rd-asc {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(255, 255, 255, 0.03);
}

.rd-asc.has-ranks {
    border-color: rgba(250, 204, 21, 0.55);
}

.rd-asc.maxed {
    background: rgba(250, 204, 21, 0.1);
}

.rd-asc.capstone {
    border-color: rgba(168, 85, 247, 0.7);
    background: linear-gradient(120deg, rgba(168, 85, 247, 0.16), rgba(250, 204, 21, 0.08));
}

.rd-asc-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.rd-asc-copy p {
    margin: 2px 0 4px;
    color: var(--muted);
    font-size: 0.8rem;
}

.rd-asc-copy small {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
}

.rd-asc-side {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.rd-pips {
    display: flex;
    gap: 3px;
}

.rd-pips i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.rd-pips i.on {
    background: #facc15;
}

.rd-asc-add {
    min-width: 44px;
    padding: 4px 10px;
    font-weight: 800;
}


/* The Shop's Fishing Rod tab */
.rd-shop-card p {
    margin: 0 0 8px;
}

.rd-shop-levels {
    color: var(--muted);
    font-weight: 700;
}

.rd-shop-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


@media (max-width: 960px) {
    .rd-parts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
