* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #141f3f 0%, #0b2481 100%);
    background-attachment: fixed;
    color: #f0f4f8;
    padding: 20px 16px 50px 16px;
    overflow-x: hidden;
}

.main-content {
    width: 100%;
    max-width: 865px;
    margin: 50px auto 30px auto;
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.gold-bevel-border {
    border: 4px solid #caa038;
    border-top-color: #ffd966;
    border-left-color: #f6c845;
    border-right-color: #8c6218;
    border-bottom-color: #5c3d0b;
    border-radius: 6px;
    box-shadow:
        inset 2px 2px 0 #ffe899,
        inset -2px -2px 0 #4a330a,
        0 6px 16px rgba(0, 0, 0, 0.55);
    background-color: #141822;
}

.header-section {
    position: relative;
    width: 100%;
}

.logo-wrapper {
    margin: 0;
    padding: 0;
    line-height: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
}

.floating-logo {
    position: absolute;
    top: -65px;
    left: -32px;
    width: 290px;
    max-width: 46%;
    height: auto;
    z-index: 15;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.85));
    transition: transform 0.2s ease;
}

.floating-logo:hover {
    transform: scale(1.02);
}

.header-banner {
    position: relative;
    width: 100%;
    height: 290px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #243356 0%, #1a253e 50%, #222f4d 100%);
}

.header-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow:
        inset 2px 2px 0 #ffe899,
        inset -2px -2px 0 #4a330a;
    pointer-events: none;
    z-index: 10;
}

.banner-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 55%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 15%, rgba(0, 0, 0, 0.85) 30%, rgba(0, 0, 0, 0.6) 45%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0.15) 75%, rgba(0, 0, 0, 0.04) 88%, transparent 98%);
    mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 15%, rgba(0, 0, 0, 0.85) 30%, rgba(0, 0, 0, 0.6) 45%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0.15) 75%, rgba(0, 0, 0, 0.04) 88%, transparent 98%);
}

.main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.banner-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    text-align: center;
    width: 100%;
    max-width: 380px;
    pointer-events: none;
}

.pull-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pull-text .text-row {
    display: block;
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 2.15rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    line-height: 1.1;
    text-transform: uppercase;
    background: linear-gradient(180deg, #f5a623 0%, #ffd066 38%, #ffffff 88%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    filter: drop-shadow(1.5px 1.5px 0 #000) drop-shadow(-1.5px -1.5px 0 #000) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.85));
}

.banner-right {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    padding-right: 18px;
    padding-bottom: 14px;
    pointer-events: none;
}

.character-art {
    position: absolute;
    right: -5px;
    bottom: 0;
    height: 100%;
    max-height: 290px;
    width: auto;
    object-fit: contain;
    object-position: bottom right;
    pointer-events: none;
    filter: drop-shadow(-6px 4px 10px rgba(0, 0, 0, 0.75));
}

.steam-btn-wrapper {
    position: relative;
    z-index: 6;
    pointer-events: auto;
}

.btn-gold {
    background: linear-gradient(180deg, #ffe066 0%, #d49f1a 45%, #946900 100%);
    color: #171000;
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border-radius: 4px;
    border: 2px solid #3b2800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.75),
        inset -1px -1px 0 rgba(0, 0, 0, 0.4),
        0 3px 0 #2e1f00,
        0 5px 8px rgba(0, 0, 0, 0.55);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.08s ease, filter 0.08s ease, box-shadow 0.08s ease;
}

.btn-gold:hover {
    filter: brightness(1.15);
}

.btn-gold:active {
    transform: translateY(2px);
    box-shadow:
        inset 1px 1px 0 rgba(0, 0, 0, 0.45),
        inset -1px -1px 0 rgba(255, 255, 255, 0.4),
        0 1px 0 #2e1f00,
        0 2px 4px rgba(0, 0, 0, 0.5);
}

.steam-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.button-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 16px;
    width: 100%;
}

.btn {
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: center;
    gap: 12px;
    flex: 1 1 230px;
    padding: 14px 18px;
    min-height: 72px;
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #ffffff;
    cursor: pointer;
    border-radius: 6px;
    border: 3px solid #141414;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
    box-shadow:
        inset 2px 2px 0 rgba(255, 255, 255, 0.55),
        inset -2px -2px 0 rgba(0, 0, 0, 0.4),
        0 4px 0 #141414,
        0 6px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
    user-select: none;
    text-decoration: none;
}

.btn-icon-wrapper {
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-icon {
    max-height: 40px;
    max-width: 44px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.5));
}

.btn-text {
    text-align: center;
    line-height: 1.2;
}

.btn:hover {
    filter: brightness(1.12);
}

.btn:active {
    transform: translateY(3px);
    box-shadow:
        inset 2px 2px 0 rgba(0, 0, 0, 0.4),
        inset -2px -2px 0 rgba(255, 255, 255, 0.3),
        0 1px 0 #141414,
        0 2px 4px rgba(0, 0, 0, 0.35);
}

.btn:focus-visible {
    outline: 3px dashed #caa038;
    outline-offset: 4px;
}

.btn-orange {
    background: linear-gradient(180deg, #ff9f1a 0%, #e65c00 100%);
}

.btn-purple {
    background: linear-gradient(180deg, #b042ff 0%, #6d1b9d 100%);
}

.btn-green {
    background: linear-gradient(180deg, #32d74b 0%, #1e824c 100%);
}

.content-columns {
    display: flex;
    align-items: stretch;
    gap: 18px;
    width: 100%;
}

.box-main {
    flex: 4;
    min-height: 240px;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.intro-lead {
    font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #f0f4f8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    margin-bottom: 20px;
}

.intro-lead strong {
    color: #ffd966;
    font-weight: bold;
}

.punch-list {
    list-style-type: disc;
    padding-left: 24px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.punch-list li {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 0.98rem;
    font-weight: 900;
    letter-spacing: 0.3px;
    color: #ffd966;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}

.punch-list li::marker {
    color: #ffd000;
    font-size: 1.1rem;
}

.box-side {
    flex: 1;
    min-width: 150px;
    min-height: 240px;
    padding: 20px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pack-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    gap: 12px;
}

.pack-img {
    width: 100%;
    max-width: 135px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.75));
    transition: transform 0.2s ease;
}

.pack-img:hover {
    transform: scale(1.05);
}

.pack-tagline {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #ffd700;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 0 #000, 0 3px 6px rgba(0, 0, 0, 0.85);
}

@media (max-width: 865px) {
    .main-content {
        margin-top: 40px;
        padding: 18px;
    }

    .floating-logo {
        top: -45px;
        left: -10px;
        width: 230px;
    }
}

@media (max-width: 680px) {
    body {
        padding: 12px 10px;
    }

    .main-content {
        margin-top: 30px;
        padding: 14px;
        gap: 16px;
    }

    .floating-logo {
        position: static;
        display: block;
        margin: 0 auto 12px auto;
        width: 220px;
        max-width: 75%;
    }

    .header-banner {
        height: auto;
        min-height: 260px;
        flex-direction: column;
        justify-content: center;
        padding: 24px 14px;
    }

    .banner-left {
        width: 100%;
        opacity: 0.35;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .main-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
        transform: none;
        left: 0;
        top: 0;
    }

    .pull-text .text-row {
        font-size: 1.6rem;
    }

    .banner-center {
        position: static;
        transform: none;
        max-width: 100%;
        margin-bottom: 16px;
    }

    .banner-right {
        position: static;
        width: 100%;
        align-items: center;
        padding-right: 0;
        padding-bottom: 0;
    }

    .character-art {
        display: none;
    }

    .content-columns {
        flex-direction: column;
    }

    .box-main,
    .box-side {
        width: 100%;
        min-height: auto;
        padding: 20px 18px;
    }

    .pack-img {
        max-width: 150px;
    }
}

.gallery-body {
    min-height: 100vh;
}

.gallery-main {
    width: 95%;
    max-width: 1540px;
    margin: 30px auto;
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 6px;
}

.gallery-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.gallery-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.gallery-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
    transition: transform 0.2s ease;
}

.gallery-logo:hover {
    transform: scale(1.04);
}

.gallery-title {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 2.1rem;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0 #000;
    margin: 0;
}

.return-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    height: 40px;
    padding: 0 20px;
    font-size: 0.88rem;
    grid-template-columns: none;
    line-height: 1;
}

.filter-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
    overflow: hidden;
}

.search-row {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 13px 44px 13px 18px;
    font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
    font-size: 1.05rem;
    background: #0c1018;
    color: #f0f4f8;
    border: 2px solid #8c6218;
    border-radius: 6px;
    outline: none;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.6);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
    border-color: #ffd966;
    box-shadow: 0 0 8px rgba(255, 217, 102, 0.4), inset 1px 1px 3px rgba(0, 0, 0, 0.6);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ffd966;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: none;
    padding: 6px;
    line-height: 1;
}

.search-clear-btn:hover {
    color: #ffffff;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffd966;
    text-shadow: 1px 1px 0 #000;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    background: #0c1018;
    color: #f0f4f8;
    border: 2px solid #8c6218;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.filter-select:focus,
.filter-select:hover {
    border-color: #ffd966;
}

.filter-actions {
    grid-column: span 2;
    min-width: 0;
    width: 100%;
}

.action-buttons-row {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    min-height: 40px;
    height: 40px;
    padding: 0 8px;
    font-size: 0.82rem;
    grid-template-columns: none;
    line-height: 1;
    white-space: nowrap;
}

.reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 40px;
    height: 40px;
    padding: 0 10px;
    font-size: 0.85rem;
    grid-template-columns: none;
    line-height: 1;
}

.results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(202, 160, 56, 0.25);
}

.results-count {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 0.95rem;
    color: #ffd966;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0 #000;
}

.gallery-content {
    width: 100%;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 18px;
    width: 100%;
}

.gallery-card {
    display: block;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
    background: #121620;
    line-height: 0;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.75), 0 0 12px rgba(255, 217, 102, 0.45);
    border-color: #ffd966;
}

.gallery-card:focus-visible {
    outline: 3px dashed #ffd966;
    outline-offset: 4px;
}

.gallery-card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 357 / 499;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.badge {
    display: inline-block;
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.3px;
    padding: 3px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    border: 1px solid rgba(0, 0, 0, 0.5);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
}

.badge-set {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #1e40af;
}

.badge-cost {
    background: #854d0e;
    color: #fde047;
    border-color: #ca8a04;
}

.badge-type {
    background: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}

.badge-rarity {
    background: #581c87;
    color: #d8b4fe;
    border-color: #7e22ce;
}

.badge-ace {
    background: linear-gradient(180deg, #ff9f1a, #e65c00);
    color: #ffffff;
    border-color: #9a3412;
}

.badge-attr {
    background: #14532d;
    color: #86efac;
    border-color: #166534;
}

.badge-sec-type {
    background: #0f4c3a;
    color: #6ee7b7;
    border-color: #059669;
}

.empty-state {
    padding: 50px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-state h2 {
    font-family: 'Arial Black', Impact, sans-serif;
    color: #ffd700;
    text-transform: uppercase;
    font-size: 1.8rem;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0 #000;
    margin: 0;
}

.empty-state p {
    color: #f0f4f8;
    font-size: 1.05rem;
    max-width: 480px;
}

.empty-state .action-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 0 24px;
    min-height: 44px;
    height: 44px;
    font-size: 0.95rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 13, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    max-width: 840px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    gap: 28px;
    padding: 28px;
    position: relative;
    background-color: #141822;
    border-radius: 8px;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: #1e2430;
    border: 2px solid #8c6218;
    border-radius: 4px;
    color: #ffd966;
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    z-index: 10;
}

.modal-close-btn:hover {
    background: #ffd966;
    color: #141822;
    border-color: #ffd966;
    transform: scale(1.05);
}

.modal-image-col {
    flex: 1;
    max-width: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 357 / 499;
    object-fit: contain;
    border-radius: 6px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.75));
}

.modal-details-col {
    flex: 1.3;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-card-name {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 1.7rem;
    color: #ffd700;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 0 #000;
    margin: 0;
    line-height: 1.2;
}

.modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modal-stats {
    display: flex;
    gap: 12px;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    border-radius: 4px;
    border: 2px solid;
    min-width: 90px;
}

.stat-atk {
    background: linear-gradient(180deg, #3f1010, #220808);
    border-color: #b91c1c;
    color: #fca5a5;
}

.stat-hp {
    background: linear-gradient(180deg, #0e371d, #081e10);
    border-color: #15803d;
    color: #86efac;
}

.stat-label {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1.1;
}

.modal-text-box {
    padding: 14px 16px;
    background: #0b0e14;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-section-title {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffd966;
    margin: 0;
}

.modal-card-text {
    font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #f0f4f8;
    margin: 0;
    white-space: pre-line;
}

.modal-footer-meta {
    font-family: 'Trebuchet MS', sans-serif;
    font-size: 0.9rem;
    color: #ffd966;
    font-style: italic;
}

.modal-nav-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 10px;
}

.modal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    min-height: 40px;
    height: 40px;
    padding: 0 16px;
    font-size: 0.88rem;
    grid-template-columns: none;
    line-height: 1;
}

.modal-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.8);
    transform: none;
}

@media (max-width: 865px) {
    .gallery-main {
        width: 100%;
        margin: 15px auto;
        padding: 16px;
        gap: 16px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .gallery-title {
        font-size: 1.7rem;
    }
}

@media (max-width: 680px) {
    .gallery-header {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-header-left {
        justify-content: center;
    }

    .return-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        flex: 1 1 auto;
    }

    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-sort-group {
        grid-column: span 2;
    }

    .filter-actions {
        grid-column: span 2;
        min-width: 0;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-card {
        padding: 5px;
    }

    .badge {
        font-size: 0.6rem;
        padding: 2px 4px;
    }

    .modal-content {
        flex-direction: column;
        padding: 20px 16px;
        max-height: 94vh;
        gap: 16px;
    }

    .modal-image-col {
        max-width: 220px;
        margin: 0 auto;
    }

    .modal-card-name {
        font-size: 1.3rem;
        text-align: center;
    }

    .modal-badges {
        justify-content: center;
    }

    .modal-stats {
        justify-content: center;
    }
}
