/**
 * The profile showcase (M-023): components/showcase/* on the profile and, read-only, on a friend's profile. The bar
 * with "Montar vitrine", the blocks (featured games, favorites, proud achievements, setup; the masterpieces keep
 * css/components/masterpiece.css), the invitation of the empty showcase, the editor of js/components/showcase.js and
 * the setup form over the shared site dialogs. Semantic tokens of the media kit only.
 */

/* ================== SECTION ================== */
.showcase {
    display: flex;
    flex-direction: column;
    gap: 36px;
    scroll-margin-top: calc(var(--site-header-h, 58px) + 16px);
}

.profile-showcase {
    padding-top: 40px;
}

.friend-profile-showcase {
    padding-top: 44px;
}

/* The kicker of the showcase and, on the owner's profile, "Montar vitrine" (Salvar and Cancelar while editing) */
.showcase-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.showcase-bar-text {
    flex: 1 1 280px;
    min-width: 0;
}

.showcase-kicker {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.showcase-bar-hint {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-2);
}

.showcase-bar-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Editing, the bar stays in reach under the header */
.showcase.is-editing .showcase-bar {
    position: sticky;
    top: calc(var(--site-header-h, 58px) + 8px);
    z-index: 20;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line-strong));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface-1) 94%, transparent);
    backdrop-filter: blur(8px);
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
}

.showcase-blocks {
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.showcase-blocks:empty {
    display: none;
}

.showcase-block-head {
    align-items: center;
}

.showcase-block-empty {
    padding: 32px 24px;
}

/* ================== FEATURED GAMES ================== */
.showcase-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.showcase-game-link {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    height: 100%;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--surface-1);
    box-shadow: inset 0 0 0 1px var(--line);
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.showcase-game-link:hover,
.showcase-game-link:focus-visible {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px var(--module), 0 22px 40px -26px rgba(0, 0, 0, 0.9);
}

.showcase-game-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* A platform with every achievement: the gold of the masterpieces */
.showcase-game.is-platinum .showcase-game-link {
    background: linear-gradient(135deg, color-mix(in srgb, var(--masterpiece) 9%, var(--surface-1)) 0%, var(--surface-1) 55%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--masterpiece) 40%, var(--line));
}

.showcase-game.is-platinum .showcase-game-link:hover,
.showcase-game.is-platinum .showcase-game-link:focus-visible {
    box-shadow: inset 0 0 0 1px var(--masterpiece), 0 22px 40px -26px color-mix(in srgb, var(--masterpiece) 50%, transparent);
}

.showcase-game-cover {
    border-radius: var(--radius-sm);
}

.showcase-game-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding-top: 2px;
}

.showcase-game-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
    color: var(--text-1);
}

.showcase-game-hours {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.showcase-number {
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 42px;
    line-height: 0.85;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
}

.showcase-unit {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
}

.showcase-achievements {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: stretch;
}

.showcase-achievements-text {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
}

.showcase-achievements-text > i {
    font-size: 11px;
    color: var(--accent);
}

.showcase-progress {
    display: block;
    width: 100%;
    height: 6px;
    border: 0;
    border-radius: 3px;
    background: var(--surface-3);
    overflow: hidden;
    appearance: none;
    color: var(--module);
}

.showcase-progress::-webkit-progress-bar {
    border-radius: 3px;
    background: var(--surface-3);
}

.showcase-progress::-webkit-progress-value {
    border-radius: 3px;
    background: var(--module);
}

.showcase-progress::-moz-progress-bar {
    border-radius: 3px;
    background: var(--module);
}

.showcase-game.is-platinum .showcase-progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--accent), var(--masterpiece));
}

.showcase-game.is-platinum .showcase-progress::-moz-progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--masterpiece));
}

/* The platinum seal, on the featured games and on the covers of the proud ones */
.showcase-platinum,
.showcase-trophy-seal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 10px 0 8px;
    border-radius: 11px;
    background: var(--masterpiece-gradient);
    font-size: 11px;
    font-weight: 700;
    line-height: 22px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--on-masterpiece);
}

.showcase-platinum > i,
.showcase-trophy-seal > i {
    font-size: 10px;
}

/* ================== FAVORITES AND PROUD ACHIEVEMENTS ================== */
.showcase-posters,
.showcase-trophies {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 176px));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.showcase-poster-link,
.showcase-trophy-link {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.showcase-poster-cover,
.showcase-trophy-cover {
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.showcase-poster-cover .module-chip {
    top: 8px;
    left: 8px;
}

.showcase-poster-link:hover .showcase-poster-cover,
.showcase-poster-link:focus-visible .showcase-poster-cover {
    transform: translateY(-3px);
    box-shadow: 0 0 0 2px var(--module), 0 22px 40px -22px rgba(0, 0, 0, 0.9);
}

.showcase-trophy-cover {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--masterpiece) 55%, transparent),
        0 18px 38px -18px color-mix(in srgb, var(--masterpiece) 55%, transparent);
}

.showcase-trophy-link:hover .showcase-trophy-cover,
.showcase-trophy-link:focus-visible .showcase-trophy-cover {
    transform: translateY(-3px);
    box-shadow: 0 0 0 2px var(--masterpiece), 0 22px 44px -18px color-mix(in srgb, var(--masterpiece) 70%, transparent);
}

.showcase-poster-link:focus-visible,
.showcase-trophy-link:focus-visible {
    outline: none;
}

/* At the top, where the typographic poster of a missing cover leaves room */
.showcase-trophy-seal {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
}

.showcase-poster-name,
.showcase-trophy-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 19px;
    color: var(--text-1);
}

.showcase-poster-link:hover .showcase-poster-name {
    color: var(--module);
}

.showcase-trophy-link:hover .showcase-trophy-name {
    color: var(--masterpiece);
}

.showcase-trophy-meta,
.showcase-trophy-date {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -4px;
    font-size: 13px;
    line-height: 18px;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
}

.showcase-trophy-meta > i {
    font-size: 11px;
    color: var(--masterpiece);
}

/* ================== SETUP ================== */
.showcase-setup {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.showcase-setup-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 14px 18px 14px 14px;
    border-radius: var(--radius);
    background: var(--surface-1);
    box-shadow: inset 0 0 0 1px var(--line);
}

.showcase-setup-icon,
.showcase-gear-icon,
.showcase-row-icon,
.showcase-suggestion-icon {
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
}

.showcase-setup-icon {
    width: 46px;
    height: 46px;
    font-size: 18px;
}

.showcase-setup-text,
.showcase-gear-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.showcase-setup-kind,
.showcase-gear-kind {
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
}

.showcase-setup-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    overflow-wrap: anywhere;
    color: var(--text-1);
}

.showcase-setup-note {
    font-size: 13px;
    line-height: 18px;
    overflow-wrap: anywhere;
    color: var(--text-2);
}

/* ================== EMPTY SHOWCASE ================== */
.showcase-invite {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px;
    border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line-strong));
    border-radius: var(--radius);
    background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft) 0%, transparent 55%), var(--surface-1);
}

.showcase-invite-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 32px;
    line-height: 1;
    letter-spacing: 0.01em;
    color: var(--text-1);
}

.showcase-invite-lead {
    max-width: 680px;
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 21px;
    color: var(--text-2);
}

.showcase-invite-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.showcase-suggestion {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 14px;
    row-gap: 2px;
    width: 100%;
    height: 100%;
    padding: 14px 16px 14px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.showcase-suggestion:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.showcase-suggestion:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.showcase-suggestion-icon {
    grid-row: span 2;
    width: 40px;
    height: 40px;
    font-size: 15px;
}

.showcase-suggestion-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
    color: var(--text-1);
}

.showcase-suggestion-text {
    font-size: 13px;
    line-height: 18px;
    color: var(--text-2);
}

/* ================== EDITOR ================== */
.showcase-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.showcase-editor-hint {
    max-width: 760px;
    margin: 0;
    font-size: 14px;
    line-height: 21px;
    color: var(--text-2);
}

.showcase-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Each block as a dashed row with its handle, like the masterpieces while they are arranged */
.showcase-row {
    padding: 14px 16px;
    border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line-strong));
    border-radius: var(--radius);
    background: var(--surface-1);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.showcase-row:focus-within {
    border-color: var(--accent);
}

.showcase-row.is-off {
    border-color: var(--line-strong);
    background: color-mix(in srgb, var(--surface-1) 50%, transparent);
}

.showcase-row.is-off .showcase-row-icon,
.showcase-row.is-off .showcase-row-text,
.showcase-row.is-off .showcase-row-body {
    opacity: 0.55;
}

.showcase-row.is-dragging {
    opacity: 0.45;
}

.showcase-row-head {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
}

.showcase-row-handle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    font-size: 15px;
    color: var(--text-2);
    cursor: grab;
}

.showcase-row-handle:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

.showcase-row-handle:focus-visible,
.showcase-row-move:focus-visible,
.showcase-chip-remove:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.showcase-row-icon {
    width: 40px;
    height: 40px;
    font-size: 15px;
}

.showcase-row-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.showcase-row-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    color: var(--text-1);
}

.showcase-row-hint {
    font-size: 13px;
    line-height: 18px;
    color: var(--text-2);
}

.showcase-row-moves {
    display: flex;
    gap: 6px;
}

.showcase-row-move {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface-1);
    font-size: 12px;
    color: var(--text-1);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.showcase-row-move:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.showcase-row-move:disabled {
    opacity: 0.35;
    cursor: default;
}

.showcase-row-switch {
    min-width: 116px;
}

.showcase-row-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin: 14px 0 0 98px;
}

.showcase-row-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.showcase-row-items.is-gear {
    flex-direction: column;
    align-self: stretch;
}

.showcase-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.showcase-row-count {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
}

/* A chosen title */
.showcase-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 260px;
    padding: 4px 4px 4px 4px;
    border-radius: 8px;
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--line);
}

.showcase-chip-cover {
    flex: none;
    width: 30px;
    border-radius: 4px;
    box-shadow: none;
}

.showcase-chip-cover .poster-fallback {
    padding: 0;
}

.showcase-chip-cover .poster-fallback-bar,
.showcase-chip-cover .poster-fallback-title {
    display: none;
}

.showcase-chip-name {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-1);
}

.showcase-chip-remove {
    display: grid;
    flex: none;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
}

.showcase-chip-remove:hover {
    background: color-mix(in srgb, var(--danger) 18%, transparent);
    color: var(--danger);
}

/* A setup item in the editor */
.showcase-gear {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 8px;
    border-radius: 8px;
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--line);
}

.showcase-gear-icon {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

.showcase-gear-name {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 19px;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-1);
}

.showcase-gear-note {
    overflow: hidden;
    font-size: 12.5px;
    line-height: 17px;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-2);
}

/* ================== SETUP FORM ================== */
.showcase-setup-dialog .site-dialog-panel {
    width: min(480px, 100%);
}

.showcase-setup-label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dialog-text, var(--text-1));
}

.showcase-setup-error {
    color: var(--danger);
}

/* ================== RESPONSIVE ================== */
@media (max-width: 1399.98px) {
    .showcase-posters,
    .showcase-trophies {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .showcase-posters,
    .showcase-trophies {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 132px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        padding-bottom: 6px;
    }

    .showcase-poster,
    .showcase-trophy {
        scroll-snap-align: start;
    }
}

@media (max-width: 767.98px) {
    .showcase {
        gap: 28px;
    }

    .profile-showcase,
    .friend-profile-showcase {
        padding-top: 28px;
    }

    .showcase-blocks {
        gap: 44px;
    }

    .showcase-games,
    .showcase-setup {
        grid-template-columns: minmax(0, 1fr);
    }

    .showcase-game-link {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 14px;
        padding: 12px;
    }

    .showcase-number {
        font-size: 36px;
    }

    .showcase-invite {
        padding: 22px 18px;
    }

    .showcase-invite-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .showcase-bar-tools {
        width: 100%;
    }

    .showcase-bar-tools .kit-button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .showcase-row {
        padding: 12px;
    }

    .showcase-row-head {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "handle text text"
            "moves moves switch";
        row-gap: 10px;
    }

    .showcase-row-handle {
        grid-area: handle;
    }

    .showcase-row-icon {
        display: none;
    }

    .showcase-row-text {
        grid-area: text;
    }

    .showcase-row-moves {
        grid-area: moves;
    }

    .showcase-row-switch {
        grid-area: switch;
        min-width: 0;
        justify-self: end;
    }

    .showcase-row-body {
        margin-left: 0;
    }

    .showcase-chip {
        max-width: 100%;
    }
}

/* Phones keep only the kicker and the two buttons on the bar that follows the editing */
@media (max-width: 575.98px) {
    .showcase.is-editing .showcase-bar {
        padding: 12px;
    }

    .showcase.is-editing .showcase-bar-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showcase-game-link,
    .showcase-poster-cover,
    .showcase-trophy-cover,
    .showcase-suggestion {
        transition: none;
    }
}
