/* Interrupteurs bibliothèque (Possédé, Joué, Wishlist).
   Dans une carte « On en parle », ils sont à droite, avec Acheter. */

.umdj-game-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(8.75rem, 1fr));
    align-items: stretch;
    gap: 8px;
    justify-self: end;
    align-self: center;
    width: max-content;
    max-width: 100%;
}

.umdj-game-actions .umdj-game-flags {
    display: contents;
    margin: 0;
}

.umdj-game-actions .umdj-game-flag,
.news-related-game-row .umdj-game-actions .news-related-game-buy,
.news-related-game-row .umdj-game-actions a.news-related-game-buy {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    justify-self: stretch;
    grid-area: auto;
}

.umdj-game-actions .umdj-game-flag {
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.2;
    justify-content: space-between;
}

.news-related-game-row .umdj-game-actions .news-related-game-buy,
.news-related-game-row .umdj-game-actions a.news-related-game-buy {
    justify-content: center;
}

.news-related-game-hearts:not(:has(.news-related-game-heart)) {
    display: none;
    min-width: 0;
}

.umdj-game-actions .umdj-game-flag-switch {
    width: 28px;
    height: 16px;
}

.umdj-game-actions .umdj-game-flag-knob {
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
}

.umdj-game-actions .umdj-game-flag.is-on .umdj-game-flag-knob {
    transform: translateX(12px);
}

@media (max-width: 720px) {
    .news-related-game-row {
        min-width: 0;
    }

    .news-related-game-row .umdj-game-actions {
        grid-column: 1 / -1;
        grid-row: auto;
        width: 100%;
        max-width: 100%;
        justify-self: stretch;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .news-related-game-row .umdj-game-actions .umdj-game-flag,
    .news-related-game-row .umdj-game-actions .news-related-game-buy {
        padding: 8px 10px;
        font-size: 12px;
    }

    .news-related-game-row .umdj-game-actions .umdj-game-flag-switch {
        width: 24px;
        height: 14px;
    }

    .news-related-game-row .umdj-game-actions .umdj-game-flag-knob {
        width: 10px;
        height: 10px;
    }

    .news-related-game-row .umdj-game-actions .umdj-game-flag.is-on .umdj-game-flag-knob {
        transform: translateX(10px);
    }
}

.umdj-game-flags {
    display: inline;
    margin: 0 0.15em 0 0.4em;
    vertical-align: middle;
    line-height: 1;
    white-space: normal;
}

.umdj-game-flag {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 1px 4px 1px 0;
    padding: 3px 8px 3px 10px;
    border: 0;
    border-radius: 999px;
    background: #171c24;
    color: #8b929c;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    vertical-align: middle;
    cursor: pointer;
    max-width: 100%;
    box-sizing: border-box;
}

.umdj-game-flag-label {
    font-weight: 800;
}

.umdj-game-flag-switch {
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    height: 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
}

.umdj-game-flag-knob {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.15s ease;
}

.umdj-game-flag.is-on .umdj-game-flag-knob {
    transform: translateX(10px);
}

.umdj-game-flag[data-flag="owned"],
.umdj-game-flag[data-flag="played"] {
    background: #171c24;
    color: #8b929c;
}

.umdj-game-flag[data-flag="owned"].is-on,
.umdj-game-flag[data-flag="played"].is-on {
    background: #c5cbd4;
    color: #2a2e36;
}

.umdj-game-flag[data-flag="wishlist"] {
    background: #274967;
    color: #8ca4b6;
}

.umdj-game-flag[data-flag="wishlist"].is-on {
    background: #2e6da8;
    color: #fff;
}

.umdj-game-flags.is-guest .umdj-game-flag {
    opacity: 0.72;
    cursor: pointer;
}

.umdj-game-flag:disabled {
    cursor: wait;
}

.umdj-game-flag:focus-visible {
    outline: 2px solid #9b1c1f;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .umdj-game-flag-knob {
        transition: none;
    }
}
