/* Cinema Compact: one square, full-art deck item on every surface. */
.public-deck-grid,
.library-deck-row,
.library-favorite-deck-row { --deck-item-columns: 1; }

.public-deck-grid { grid-template-columns: repeat(var(--deck-item-columns), minmax(0, 1fr)); }

@media (min-width: 36rem) {
    .public-deck-grid, .library-deck-row, .library-favorite-deck-row { --deck-item-columns: 2; }
}
@media (min-width: 51rem) {
    .public-deck-grid, .library-deck-row, .library-favorite-deck-row { --deck-item-columns: 3; }
}
@media (min-width: 67rem) {
    .public-deck-grid, .library-deck-row, .library-favorite-deck-row { --deck-item-columns: 4; }
}

.shared-deck-item {
    container-type: inline-size;
    display: grid;
    min-width: 0;
    height: auto;
    aspect-ratio: 1;
    background: #1a232c;
    color: #f5f7fa;
    box-shadow: none;
    cursor: pointer;
}

.shared-deck-item:hover {
    background: #1a232c;
    box-shadow: none;
    transform: none;
}

.shared-deck-item .shared-deck-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: inherit;
    background:
        radial-gradient(circle at 50% 38%, transparent 24%, #ffffff0d 24.3%, transparent 24.7%, transparent 40%, #ffffff0c 40.4%, transparent 40.8%),
        linear-gradient(145deg, #34414e, #1a232d 70%);
}

.shared-deck-art::before { display: none; }

.shared-deck-item .shared-deck-art::after {
    content: "";
    position: absolute;
    display: block;
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, #06090c10 0%, #06090c05 25%, #06090cae 50%, #06090ce6 72%, #090d11fa 100%);
    pointer-events: none;
}

.shared-deck-art .deck-glyph {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #cbd4de99;
    font-size: clamp(1.8rem, 12cqi, 3.8rem);
}

.shared-deck-stats {
    position: absolute;
    z-index: 2;
    top: .65rem;
    right: .65rem;
    bottom: auto;
    left: .65rem;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: .35rem;
}

.shared-deck-item .shared-deck-stats,
.shared-deck-item .shared-deck-stats:hover { text-decoration: none; }
.shared-deck-item .shared-deck-stats { gap: .35rem; }

.shared-deck-stats .shared-deck-stat {
    position: static;
    padding: .25rem .5rem;
    border: 1px solid #ffffff55;
    border-radius: 999px;
    background: #181b20eb;
    color: #fff;
    font-size: clamp(.625rem, 2.75cqi, .9rem);
    font-weight: 750;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: none;
    backdrop-filter: none;
}

/* Keep this grid item unpositioned so the title's stretched link covers the whole tile. */
.shared-deck-details {
    display: flex;
    z-index: 1;
    grid-area: 1 / 1;
    min-width: 0;
    align-self: end;
    flex-direction: column;
    gap: .4rem;
    padding: .75rem clamp(.75rem, 4cqi, 1.4rem);
}

.shared-deck-heading {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .3rem;
}

.shared-deck-title { min-width: 0; }

.shared-deck-title h3 {
    margin: 0;
    color: #f5f7fa;
    font-size: clamp(1rem, 6.2cqi, 1.75rem);
    line-height: 1.2;
}

.shared-deck-title .tile-primary-link {
    display: block;
    width: 100%;
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-deck-title .tile-primary-link:hover { color: #fff; text-decoration: none; }

.shared-deck-owner {
    margin: .2rem 0 0;
    color: #bbc6d3;
    font-size: clamp(.75rem, 3.4cqi, 1.1rem);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-deck-owner > span { font-weight: 700; }
.shared-deck-item .profile-link { display: inline; color: #c6d8e9; text-decoration-line: underline; }
.shared-deck-item .profile-link:hover { color: #fff; }

.shared-deck-item .public-deck-badges {
    max-width: none;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: .4rem;
}

.shared-deck-secondary-badges {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .4rem;
}

.shared-deck-secondary-badges::before { content: "·"; color: #bbc6d3; }

.shared-deck-item .deck-format-badge,
.shared-deck-item .deck-bracket-chip {
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #bbc6d3;
    font-size: clamp(.7rem, 3.3cqi, 1rem);
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.shared-deck-item .deck-valid-badge {
    padding: 0;
    border: 0;
    background: transparent;
    color: #a7d8bd;
    font-size: .65rem;
}

.shared-deck-item .deck-color-identity { flex: 0 0 auto; flex-wrap: nowrap; gap: clamp(.2rem, 1.3cqi, .45rem); margin: 0; }
.shared-deck-item .deck-identity-symbol { font-size: clamp(1rem, 5.25cqi, 1.75rem); }

.shared-deck-metadata {
    display: flex;
    min-height: 1.5rem;
    align-items: center;
    justify-content: space-between;
    gap: .25rem;
}

.shared-deck-state-badges {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.shared-deck-item .visibility-label,
.shared-deck-item .favorite-deck-remove {
    display: inline-flex;
    min-height: 1.5rem;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    margin: 0;
    padding: .25rem clamp(.3rem, 1.4cqi, .65rem);
    border: 1px solid #a1adba70;
    border-radius: 999px;
    background: #181c22c9;
    color: #bbc6d3;
    font-size: clamp(.6rem, 2.7cqi, .95rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
}

.shared-deck-item .favorite-deck-remove {
    border-color: #91dcbe;
    color: #91dcbe;
    background: #17382c59;
}

.shared-deck-item .favorite-deck-remove:hover {
    border-color: #b1f1d4;
    color: #b1f1d4;
    background: #24493899;
}

.shared-deck-item .favorite-deck-remove:focus-visible { outline: 2px solid #b1f1d4; outline-offset: 2px; }

.shared-deck-item .shared-deck-state-icon { width: 1em; height: 1em; flex: 0 0 auto; }

.shared-deck-item .shared-deck-favorite-form {
    position: relative;
    z-index: 2;
    display: flex;
    margin: 0;
}

.library-deck-row > .shared-deck-item,
.library-favorite-deck-row > .shared-deck-favorite-item {
    flex: 0 0 calc((100% - (var(--deck-item-columns) - 1) * 1rem) / var(--deck-item-columns));
    max-width: 100%;
}

.library-deck-row, .library-favorite-deck-row { padding-inline: 0; }

.library-favorite-deck-row > .shared-deck-favorite-item {
    position: relative;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
}

.library-favorite-deck-row > .shared-deck-favorite-item:first-child { border: 0; }
