.character-layout {
    display: grid;
    grid-template-columns: minmax(260px, 1.15fr) minmax(220px, 0.85fr);
    gap: 20px;
}

.character-picture {
    position: relative;

    width: 100%;
    height: 500px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    background: radial-gradient(
        circle,
        color-mix(
            in srgb,
            var(--character-color) 45%,
            white
        ),
        #fff 70%
    );

    border: 2px solid #000;
    border-radius: 8px;
}

.character-picture img {
    display: block;

    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;

    object-fit: cover;
    object-position: center bottom;
}

.character-details {
    align-self: center;
}

.character-label {
    display: inline-block;
    padding: 5px 8px;

    color: #000;
    background: var(--character-color);
    border: 1px solid #000;
    border-radius: 4px;

    font-weight: bold;
}

.character-details blockquote {
    margin: 18px 0;
    padding: 12px;

    background: #f7f7f7;
    border-left: 6px solid var(--character-color);

    font-style: italic;
    line-height: 1.5;
}

.character-stats {
    border: 2px solid #000;
    border-radius: 6px;
    overflow: hidden;
}

.character-stats div {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    padding: 9px 10px;
    border-bottom: 1px solid #aaa;
}

.character-stats div:last-child {
    border-bottom: 0;
}

.character-stats dt {
    color: #777;
}

.character-stats dd {
    margin: 0;
    font-weight: bold;
}

@media screen and (max-width: 650px) {
    .character-layout {
        grid-template-columns: 1fr;
    }

    .character-picture {
        height: 380px;
    }
}
/* Character directory */
.character-directory {
    min-height: 0;
}

.directory-intro {
    margin-bottom: 15px;
    font-size: 13px;
}

/*
Five compact columns fit inside the approximately
800px-wide center section.
*/
.character-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(125px, 1fr)
    );
    gap: 12px;
}

/* Individual character button/card */
.character-tile {
    --character-color: #ff86b7;

    min-width: 0;
    overflow: hidden;

    background: #f5f5f5;
    border: 2px solid #000;
    border-radius: 7px;

    box-shadow:
        2px 2px 0 var(--character-color),
        4px 4px 0 #e31bf5,
        6px 6px 0 #0099ff;

    text-align: center;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.character-tile:hover {
    transform: translate(-2px, -2px);

    box-shadow:
        3px 3px 0 var(--character-color),
        6px 6px 0 #e31bf5,
        9px 9px 0 #0099ff;
}

/* Compact character artwork */
.character-thumbnail {
    position: relative;

    width: 100%;
    height: 92px;
    display: block;
    overflow: hidden;

    background:
        radial-gradient(
            circle,
            color-mix(
                in srgb,
                var(--character-color) 45%,
                white
            ),
            #fff 75%
        );

    border-bottom: 2px solid #000;
}

.character-thumbnail::after {
    content: "";
    position: absolute;
    inset: 0;

    background: var(--character-color);
    opacity: 0;

    transition: opacity 0.15s ease;
}

.character-thumbnail:hover::after,
.character-thumbnail:focus-visible::after {
    opacity: 0.25;
}

.character-thumbnail img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
    object-position: center bottom;
}

/*
These selectors are more specific than your general
.content-box h2 rule, preventing the tile names from
receiving full-size gradient title bars.
*/
.content-box .character-tile h2 {
    margin: 0;
    padding: 7px 5px 2px;

    color: #000;
    background: transparent;
    border: 0;
    border-radius: 0;

    font-family: Monaco, monospace;
    font-size: 13px;
    font-style: normal;
    line-height: 1.1;

    text-shadow: none;
}

.character-tile > p {
    min-height: 14px;
    margin: 0;
    padding: 0 5px 7px;

    color: #777;
    font-size: 9px;
    line-height: 1.2;
    text-transform: uppercase;
}

/* Lore and artwork buttons */
.character-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;

    border-top: 1px solid #000;
}

.content-box .character-actions a {
    padding: 6px 2px;

    color: #000;
    background: #fff;

    font-size: 9px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;

    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.content-box .character-actions a + a {
    border-left: 1px solid #000;
}

.content-box .character-actions a:hover,
.content-box .character-actions a:focus-visible {
    color: #000;
    background: var(--character-color);
}

/* Tablet */
@media screen and (max-width: 800px) {
    .character-grid {
        grid-template-columns: repeat(
            auto-fit,
            minmax(130px, 1fr)
        );
    }
}

/* Phone */
@media screen and (max-width: 430px) {
    .character-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .character-thumbnail {
        height: 105px;
    }
}