:root {
    --gn-tier-s: rgba(59, 130, 246, 0.22);
    --gn-tier-a: rgba(45, 212, 191, 0.2);
    --gn-tier-b: rgba(248, 113, 113, 0.18);
    --gn-tier-c: rgba(250, 204, 21, 0.2);
    --gn-tier-d: rgba(148, 163, 184, 0.2);
}

    :root[data-bs-theme="light"] {
        --gn-tier-s: rgba(59, 130, 246, 0.16);
        --gn-tier-a: rgba(20, 184, 166, 0.16);
        --gn-tier-b: rgba(248, 113, 113, 0.12);
        --gn-tier-c: rgba(250, 204, 21, 0.16);
        --gn-tier-d: rgba(100, 116, 139, 0.12);
    }

.tier-editor-hero {
    background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.18), transparent 45%), radial-gradient(circle at 85% 80%, rgba(59, 130, 246, 0.12), transparent 40%), var(--gn-surface);
}

body.tier-snapshot .tier-editor-pool {
    position: static !important;
    box-shadow: none;
}

body.tier-snapshot #tier-editor-board {
    padding-bottom: 0;
}

.tier-editor-hero-body {
    padding: 0.45rem 1rem;
}

.tier-editor-hero-text h1 {
    font-weight: 600;
}

.tier-editor-board,
.tier-editor-pool {
    background-color: var(--gn-surface);
}

.tier-board {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tier-row {
    display: grid;
    grid-template-columns: minmax(3.25rem, 4.5rem) 1fr;
    gap: 0.5rem;
    padding: 0.05rem;
    border-radius: var(--gn-radius-md);
    border: 1px solid rgba(59, 130, 246, 0.18);
    background-color: var(--gn-surface-2);
}

.tier-label {
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--gn-radius-sm);
    border: 1px solid rgba(59, 130, 246, 0.25);
    background-color: rgba(59, 130, 246, 0.12);
    height: 100%;
}

.tier-row-s .tier-label {
    background-color: var(--gn-tier-s);
}

.tier-row-a .tier-label {
    background-color: var(--gn-tier-a);
}

.tier-row-b .tier-label {
    background-color: var(--gn-tier-b);
}

.tier-row-c .tier-label {
    background-color: var(--gn-tier-c);
}

.tier-row-d .tier-label {
    background-color: var(--gn-tier-d);
}

.tier-items {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    height: 7.125rem;
    padding: 0.5rem;
    border-radius: var(--gn-radius-sm);
    border: 1px dashed rgba(59, 130, 246, 0.28);
    background-color: rgba(59, 130, 246, 0.05);
    transition: border-color 0.2s ease, background-color 0.2s ease;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) transparent;
    align-items: center;
    align-content: center;
}

.tier-items::-webkit-scrollbar {
    height: 0.1875rem;
}

.tier-items::-webkit-scrollbar-track {
    background: transparent;
}

.tier-items::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 99rem;
}

    .tier-items::-webkit-scrollbar-thumb:hover {
        background: rgba(59, 130, 246, 0.7);
    }

.tier-placeholder {
    color: var(--gn-muted);
    font-size: 0.9rem;
}

.tier-pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
    gap: 0.6rem;
    padding: 0.5rem;
    border-radius: var(--gn-radius-md);
    border: 1px dashed transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    height: 29.5rem;
    overflow-y: auto;
    justify-items: center;
    justify-content: start;
    align-content: start;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) transparent;
}

    .tier-pool-grid::-webkit-scrollbar {
        width: 0.1875rem;
    }

    .tier-pool-grid::-webkit-scrollbar-track {
        background: transparent;
    }

    .tier-pool-grid::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.5);
        border-radius: 99rem;
    }

        .tier-pool-grid::-webkit-scrollbar-thumb:hover {
            background: rgba(59, 130, 246, 0.7);
        }

/* Cards are now just images */
.tier-pool-card,
.tier-item {
    display: block;
    width: 6rem;
    height: 6rem;
    cursor: grab;
    position: relative;
    flex: 0 0 auto;
    border-radius: var(--gn-radius-sm);
    border: 1px solid rgba(59, 130, 246, 0.22);
    object-fit: cover;
    touch-action: none;
    -webkit-user-drag: none;
    user-select: none;
}

    .tier-pool-card:active,
    .tier-item:active {
        cursor: grabbing;
    }


.tier-items.is-dragover,
.tier-pool-grid.is-dragover {
    border-color: var(--gn-accent);
    background-color: rgba(59, 130, 246, 0.12);
}

.is-dragging {
    opacity: 0.4;
}

.tier-drag-ghost {
    opacity: 0.92;
    box-shadow: 0 0.45rem 1.1rem rgba(59, 130, 246, 0.35);
}

.tier-drag-placeholder {
    width: 6rem;
    height: 6rem;
    border-radius: var(--gn-radius-sm);
    border: 1px dashed rgba(59, 130, 246, 0.35);
    background-color: rgba(59, 130, 246, 0.06);
    flex: 0 0 auto;
}


@media (max-width: 1199.98px) {
    .tier-row {
        grid-template-columns: 1fr;
    }

    .tier-label {
        justify-content: flex-start;
        padding: 0.4rem 0.6rem;
    }

    .tier-pool-grid {
        grid-auto-flow: column;
        grid-template-rows: repeat(2, 5rem);
        grid-auto-columns: 5rem;
        overflow-x: auto;
        overflow-y: hidden;
        height: auto;
        justify-items: start;
        align-content: start;
    }

    .tier-pool-grid .tier-pool-card {
        touch-action: pan-x;
    }
}

@media (max-width: 767.98px) {
    .tier-editor-hero-body {
        padding: 0.35rem 0.75rem !important;
    }

    .tier-editor-hero-text {
        display: none;
    }

    .tier-editor-actions {
        width: 100%;
        justify-content: space-between;
    }

    .tier-editor-hero .btn {
        padding: 0.35rem 0.7rem;
    }

    #tier-editor-board {
        padding-bottom: 7.25rem;
    }

    .tier-editor-pool {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        box-shadow: 0 -0.6rem 1.4rem rgba(15, 23, 42, 0.18);
    }

        .tier-editor-pool .card-body {
            padding: 0.5rem 0.75rem;
        }

            .tier-editor-pool .card-body > .d-flex {
                display: flex;
                margin-bottom: 0.35rem;
            }

                .tier-editor-pool .card-body > .d-flex h5 {
                    display: none;
                }

    .tier-pool-grid {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.6rem;
        padding: 0.35rem 0.1rem 0.35rem 0.35rem;
        height: auto;
        min-height: 6.2rem;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
    }

    .tier-pool-card,
    .tier-item {
        width: 5.8rem;
        height: 5.8rem;
    }

    .tier-items {
        padding: 0.35rem;
    }

    .tier-items .tier-item {
        touch-action: pan-x;
    }
    .tier-items::-webkit-scrollbar {
        height: 0.45rem;
    }
}
