.meme-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
    box-sizing: border-box;
}

.meme-intro {
    text-align: center;
    margin: 0.5rem auto 1.25rem;
    max-width: 640px;
}

.meme-cats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.meme-cats a {
    padding: 6px 14px;
    background: var(--white);
    color: var(--blue-dark);
    border: 2px solid var(--blue);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
    font-weight: bold;
    text-decoration: none;
}

.meme-cats a small {
    opacity: 0.7;
}

.meme-cats a:hover,
.meme-cats a[aria-current="page"] {
    background: var(--lime);
    text-decoration: none;
}

.meme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 20px;
}

.meme-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 2.5px solid var(--blue);
    border-radius: var(--radius-lg);
    box-shadow: 5px 5px 0 var(--blue);
    overflow: hidden;
    text-decoration: none;
    color: var(--blue-dark);
    transition: transform 0.15s, box-shadow 0.15s;
}

.meme-card:hover {
    transform: rotate(-1.5deg) scale(1.03);
    box-shadow: 2px 2px 0 var(--blue);
    text-decoration: none;
}

.meme-card:active {
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 var(--blue);
}

.meme-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: var(--white);
}

.meme-card-title {
    padding: 8px 10px;
    border-top: 2.5px solid var(--blue);
    background: var(--lime);
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meme-crumbs {
    display: flex;
    gap: 8px;
    margin: 1rem 0;
    font-weight: bold;
}

.meme-single {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin-bottom: 2rem;
}

.meme-stage {
    background: var(--white);
    border: 3px solid var(--blue);
    border-radius: var(--radius-lg);
    box-shadow: 6px 6px 0 var(--blue);
    overflow: hidden;
    line-height: 0;
}

.meme-stage img {
    width: 100%;
    height: auto;
}

.meme-side h1 {
    margin: 0 0 0.5rem;
    text-transform: none;
}

.meme-desc {
    margin: 0 0 1rem;
}

.meme-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1rem;
}

.meme-btn {
    font-family: 'Original Surfer', sans-serif;
    font-size: 1.1rem;
    padding: 0.6rem 1.3rem;
    background: var(--lime);
    color: var(--blue-dark);
    border: 2.5px solid var(--blue);
    border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--blue);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, box-shadow 0.1s;
}

.meme-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 var(--blue);
    text-decoration: none;
    color: var(--blue-dark);
}

.meme-btn:active {
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 var(--blue);
}

.meme-btn-alt {
    background: var(--white);
}

.meme-fine {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.meme-status {
    min-height: 1.4em;
    font-weight: bold;
    overflow-wrap: anywhere;
}

.meme-more-title {
    font-family: 'Original Surfer', sans-serif;
    text-align: center;
    margin: 0 0 1rem;
}

@media (max-width: 800px) {
    .meme-single {
        grid-template-columns: minmax(0, 1fr);
    }
    .meme-side {
        text-align: center;
    }
    .meme-actions {
        justify-content: center;
    }
}

html.dark-mode .meme-cats a,
html.dark-mode .meme-card,
html.dark-mode .meme-stage {
    background: var(--blue-dark);
    border-color: var(--lime);
    color: var(--lime);
}

html.dark-mode .meme-cats a {
    box-shadow: 2px 2px 0 var(--lime);
}

html.dark-mode .meme-cats a:hover,
html.dark-mode .meme-cats a[aria-current="page"] {
    background: var(--blue);
}

html.dark-mode .meme-card {
    box-shadow: 5px 5px 0 var(--lime);
}

html.dark-mode .meme-card:hover {
    box-shadow: 2px 2px 0 var(--lime);
}

html.dark-mode .meme-card-title {
    background: var(--blue-dark);
    border-top-color: var(--lime);
    color: var(--lime);
}

html.dark-mode .meme-stage {
    box-shadow: 6px 6px 0 var(--lime);
}

html.dark-mode .meme-btn {
    background: var(--blue-dark);
    color: var(--lime);
    border-color: var(--lime);
    box-shadow: 4px 4px 0 var(--lime);
}

html.dark-mode .meme-btn:hover {
    background: var(--blue);
    color: var(--lime);
}

html.dark-mode .meme-btn-alt {
    background: var(--slate);
}
