/* Deck editor — shared styles for DeckBuilder and the Decks/* panels it hosts.
   Colours come from the MudBlazor palette so the editor follows the active theme. */

.de-page {
    max-width: 1440px;
    margin: 0 auto;
}

/* ---- pinned header ------------------------------------------------------ */

.de-header {
    padding: 14px 20px 12px;
}

.de-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.de-title {
    font-size: 24px;
    font-weight: 500;
    line-height: 1.3;
}

.de-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.de-meta-text {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
}

.de-meta-sep {
    width: 1px;
    height: 20px;
    background: var(--mud-palette-lines-default);
}

.de-spacer {
    flex: 1 1 auto;
}

/* ---- work area ---------------------------------------------------------- */

.de-work {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.de-pane {
    flex: 1 1 auto;
    min-width: 0;
}

.de-rail {
    width: 424px;
    flex: 0 0 auto;
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 260px);
    overflow: hidden;
}

.de-panel {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
}

.de-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.de-results {
    max-height: calc(100vh - 340px);
    overflow-y: auto;
}

.de-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* ---- filter row --------------------------------------------------------- */

.de-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0;
}

.de-pips {
    display: flex;
    gap: 4px;
    align-items: center;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 16px;
    height: 30px;
    padding: 0 8px;
}

.de-pip {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    opacity: .28;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .2);
    transition: opacity .12s ease;
}

.de-pip.de-pip-on {
    opacity: 1;
}

.de-pip-W { background: #FFFBD5; color: #5c5330; }
.de-pip-U { background: #0E68AB; color: #fff; }
.de-pip-B { background: #150B00; color: #e8e2da; }
.de-pip-R { background: #D3202A; color: #fff; }
.de-pip-G { background: #00733E; color: #fff; }

/* ---- rows --------------------------------------------------------------- */

.de-sec {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--mud-palette-background-gray);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.de-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--mud-palette-divider);
    min-height: 40px;
}

.de-row:hover {
    background: var(--mud-palette-action-default-hover);
}

/* The rail swaps the copy count for a stepper on hover; the deck list tab shows
   the stepper permanently, which is the path that works without a pointer. */
.de-row .de-hover-only {
    display: none;
}

.de-row:hover .de-hover-only {
    display: flex;
}

.de-row:hover .de-idle-only {
    display: none;
}

.de-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.de-sub {
    font-size: 11.5px;
    color: var(--mud-palette-text-secondary);
}

.de-qty {
    width: 30px;
    flex: 0 0 auto;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.de-stepper {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.de-stepper-n {
    min-width: 20px;
    text-align: center;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.de-thumb {
    border-radius: 3px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, .14);
    flex: 0 0 auto;
    object-fit: cover;
}

.de-thumb-sm { width: 32px; height: 45px; }
.de-thumb-md { width: 44px; height: 61px; }

.de-res {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.de-res:hover {
    background: var(--mud-palette-action-default-hover);
}

.de-commander {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: rgba(var(--mud-palette-primary-rgb), .08);
}

.de-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

/* ---- deck list tab ------------------------------------------------------ */

.de-table-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.de-col-set { width: 200px; flex: 0 0 auto; }
.de-col-cost { width: 100px; flex: 0 0 auto; }
.de-col-copies { width: 104px; flex: 0 0 auto; }
.de-col-act { width: 124px; flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 2px; }

/* ---- analyze tab -------------------------------------------------------- */

.de-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.de-tile {
    padding: 14px 16px;
}

.de-tile-n {
    font-size: 30px;
    font-weight: 500;
    line-height: 1.2;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.de-charts {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    align-items: stretch;
}

.de-curve {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 260px;
}

.de-curve-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    justify-content: flex-end;
    height: 100%;
}

.de-bar {
    width: 100%;
    background: var(--mud-palette-primary);
    opacity: .82;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
}

.de-bar-l {
    font-size: 11px;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.de-statrow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.de-statrow-name {
    width: 104px;
    font-size: 13px;
}

.de-track {
    display: block;
    flex: 1 1 auto;
    height: 10px;
    border-radius: 5px;
    background: var(--mud-palette-background-gray);
    overflow: hidden;
}

/* display:block is load-bearing. Both of these are spans, and width/height do not
   apply to a non-replaced inline element — the track survived only because it is a
   flex item (blockified), while the fill inside it rendered at zero size. */
.de-track-fill {
    display: block;
    height: 100%;
    background: var(--mud-palette-primary);
    opacity: .8;
}

.de-statrow-n {
    width: 30px;
    text-align: right;
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ---- narrow screens ----------------------------------------------------- */

@media (max-width: 1279px) {
    .de-work {
        flex-direction: column;
    }

    .de-rail {
        width: 100%;
        position: static;
        max-height: none;
    }

    .de-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .de-charts {
        flex-direction: column;
    }

    .de-results {
        max-height: none;
    }
}
