/* Layout follow-up for the action-card rail and Theft dialog. */

.word-rings-action-left-column {
    grid-area: players;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(100%, 240px);
    max-height: calc(100% - 16px);
    min-width: 0;
    min-height: 0;
    align-self: center;
    justify-self: center;
    overflow: visible;
}

.word-rings-action-left-column[hidden] {
    display: none !important;
}

.word-rings-action-left-column > .word-rings-players {
    box-sizing: border-box;
    flex: 1 1 auto;
    width: 100% !important;
    max-height: none !important;
    min-height: 0;
    align-self: stretch !important;
    justify-self: stretch !important;
    overflow: auto;
}

.word-rings-action-left-column > .word-rings-action-shell {
    flex: 0 0 auto;
    width: 100%;
}

.word-rings-layout.has-action-left-column:not(.has-players) {
    grid-template-columns: minmax(170px, 240px) minmax(0, 1640px) minmax(180px, 270px);
    grid-template-areas: "players stage bank";
}

/* Theft keeps both card artwork boxes identical and places target selection under the revealed card. */
.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) {
    width: min(96vw, 820px);
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-dialog-card {
    grid-template-columns: minmax(0, 308px) minmax(0, 308px);
    grid-template-areas:
        ". theft-label"
        "preview theft-card"
        ". target"
        ". word"
        ". theft-status"
        "message message"
        "actions actions";
    justify-content: center;
    column-gap: 18px;
    align-items: start;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-dialog-preview {
    grid-area: preview;
    align-self: start;
    padding: 0;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) [data-action-target-row] {
    grid-area: target;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) [data-action-word-row] {
    grid-area: word;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-theft-preview {
    display: contents;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-theft-label {
    grid-area: theft-label;
    align-self: end;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-card.is-dialog-preview,
.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-card.is-theft-preview,
.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-theft-placeholder {
    width: min(100%, 308px);
    max-width: 308px;
    aspect-ratio: 3 / 4;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-card.is-theft-preview,
.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-theft-placeholder {
    grid-area: theft-card;
    justify-self: center;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-card.is-dialog-preview,
.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-card.is-theft-preview {
    min-height: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-card.is-dialog-preview .word-rings-action-card-image,
.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-card.is-theft-preview .word-rings-action-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-theft-placeholder {
    visibility: hidden;
    pointer-events: none;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-theft-status {
    grid-area: theft-status;
    justify-self: stretch;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-dialog-message {
    grid-area: message;
}

.word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-dialog-actions {
    grid-area: actions;
}

@media (max-width: 1180px) {
    .word-rings-layout.has-action-left-column:not(.has-players) {
        grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) minmax(160px, 210px);
        gap: 8px;
    }

    .word-rings-action-left-column {
        width: 100%;
    }
}

@media (max-width: 920px) {
    .word-rings-layout.has-action-left-column:not(.has-players) {
        grid-template-columns: minmax(135px, 175px) minmax(0, 1fr) minmax(145px, 185px);
        grid-template-areas: "players stage bank";
        gap: 6px;
    }
}

@media (max-width: 680px) {
    .word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) {
        width: min(94vw, 475px);
    }

    .word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-dialog-card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "preview"
            "theft-label"
            "theft-card"
            "target"
            "word"
            "theft-status"
            "message"
            "actions";
    }

    .word-rings-action-dialog:has(.word-rings-action-theft-preview:not([hidden])) .word-rings-action-dialog-preview {
        align-self: start;
    }
}

@media (max-width: 640px) {
    .word-rings-layout.has-action-left-column:not(.has-players) {
        grid-template-columns: minmax(105px, 125px) minmax(0, 1fr) minmax(115px, 135px);
        grid-template-areas: "players stage bank";
        gap: 5px;
    }
}
