/* Punishment-board update 2: type first, visible avatars and original state artwork. */
#fox-punishment-viewport {
    /* Reserve space inside the scroll area for the first card's animated frame. */
    padding: 6px;
}

#fox-punishment-list > tr.fox-punishment-row {
    --fox-row-rgb: 234, 106, 134;
    --fox-row-art: url("../img/fox/punishment-row-ban-v1.webp");
    grid-template-columns: 76px repeat(5, minmax(0, 1fr));
    grid-template-areas: "type player reason remaining date admin";
    grid-template-rows: 36px;
    column-gap: 12px;
    padding: 4px 12px;
    border-color: rgba(var(--fox-row-rgb), .72);
    background-color: #101015;
    background-image: linear-gradient(90deg, rgba(7, 8, 13, .4), rgba(7, 8, 13, .55) 48%, rgba(7, 8, 13, .35)), var(--fox-row-art);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: inset 0 1px rgba(var(--fox-row-rgb), .08), 0 0 5px rgba(var(--fox-row-rgb), .16);
    transform: translateY(0);
    transition: transform .22s ease, filter .22s ease, border-color .22s ease, box-shadow .22s ease;
}

#fox-punishment-list > tr.fox-punishment-row--ban {
    --fox-row-rgb: 234, 106, 134;
    --fox-row-art: url("../img/fox/punishment-row-ban-v1.webp");
}

#fox-punishment-list > tr.fox-punishment-row--mute {
    --fox-row-rgb: 107, 172, 245;
    --fox-row-art: url("../img/fox/punishment-row-mute-v1.webp");
}

/* A removed ban or mute always uses the green artwork and green frame. */
#fox-punishment-list > tr.fox-punishment-row--removed {
    --fox-row-rgb: 104, 224, 160;
    --fox-row-art: url("../img/fox/punishment-row-removed-v1.webp");
    grid-template-columns: 76px repeat(5, minmax(0, 1fr));
    grid-template-areas: "type player remaining remaining remaining admin";
    padding: 4px 12px;
}

#fox-punishment-list > tr.fox-punishment-row:hover,
#fox-punishment-list > tr.fox-punishment-row:focus-within {
    border-color: rgba(var(--fox-row-rgb), .96);
    box-shadow: inset 0 0 15px rgba(var(--fox-row-rgb), .09), 0 0 5px rgba(var(--fox-row-rgb), .3);
    filter: brightness(1.1);
    transform: translateY(-1px);
}

#fox-punishment-list > tr.fox-punishment-row:focus-visible {
    outline: 1px solid rgba(var(--fox-row-rgb), .95);
    outline-offset: 2px;
}

#fox-punishment-list > .fox-punishment-row > .fox-punishment-row__type { grid-area: type; }
#fox-punishment-list > .fox-punishment-row > .fox-punishment-row__player { grid-area: player; }
#fox-punishment-list > .fox-punishment-row > .fox-punishment-row__reason { grid-area: reason; }
#fox-punishment-list > .fox-punishment-row > .fox-punishment-row__remaining { grid-area: remaining; }
#fox-punishment-list > .fox-punishment-row > .fox-punishment-row__date { grid-area: date; }
#fox-punishment-list > .fox-punishment-row > .fox-punishment-row__admin { grid-area: admin; }

/* The backend provides real avatars or its normal fallback in every state. */
#fox-punishment-list > .fox-punishment-row .fox-punishment-person img,
#fox-punishment-list > .fox-punishment-row--removed .fox-punishment-person img {
    display: block;
}

#fox-punishment-list > .fox-punishment-row .fox-punishment-person__fallback,
#fox-punishment-list > .fox-punishment-row--removed .fox-punishment-person__fallback {
    display: grid;
}

#fox-punishment-list > .fox-punishment-row .fox-punishment-person {
    gap: 8px;
}

#fox-punishment-list > .fox-punishment-row .fox-punishment-person img,
#fox-punishment-list > .fox-punishment-row .fox-punishment-person__fallback {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-color: rgba(var(--fox-row-rgb), .5);
    background-color: rgba(12, 14, 20, .85);
}

#fox-punishment-list > .fox-punishment-row .fox-punishment-person__name {
    color: var(--fox-tone-as2l19, #f0ebf6);
    font-size: 12px;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

#fox-punishment-list > .fox-punishment-row .fox-punishment-row__reason > .fox-punishment-pill {
    border-color: rgba(var(--fox-row-rgb), .3);
    color: var(--fox-tone-as1l18, #e4dfeb);
    background: rgba(9, 10, 16, .35);
}

#fox-punishment-list > .fox-punishment-row > .fox-punishment-row__remaining > .fox-punishment-pill {
    color: var(--fox-tone-as2l19, #ece5f5);
}

#fox-punishment-list > .fox-punishment-row--removed > .fox-punishment-row__remaining > .fox-punishment-pill {
    color: #8ef0b7;
}

#fox-punishment-notes > .fox-punishment-note p {
    max-width: 52ch;
    margin-inline: auto;
    text-wrap: pretty;
    line-height: 1.65;
}

@media (max-width: 1100px) {
    #fox-punishment-list > tr.fox-punishment-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(2, 36px);
        grid-template-areas: "type player reason" "remaining date admin";
        gap: 6px 12px;
    }
    #fox-punishment-list > tr.fox-punishment-row--removed {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas: "type player ." ". remaining admin";
    }
}

@media (max-width: 600px) {
    #fox-punishment-viewport { padding: 5px; }
    #fox-punishment-list > tr.fox-punishment-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, 32px);
        grid-template-areas: "type player" "reason remaining" "date admin";
        gap: 5px 10px;
        padding: 5px 8px;
    }
    #fox-punishment-list > tr.fox-punishment-row--removed {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas: "type player" "remaining remaining" ". admin";
        padding: 5px 8px;
    }
    #fox-punishment-list > .fox-punishment-row .fox-punishment-person { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    #fox-punishment-list > tr.fox-punishment-row { transition: none; }
    #fox-punishment-list > tr.fox-punishment-row:hover,
    #fox-punishment-list > tr.fox-punishment-row:focus-within { transform: none; }
}
