.shop-container {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 3rem;
    margin-top: 0.5rem;
}

.shop-products-container {
    width: 70vw;
    max-width: 100%;
}

.shop-container > .special-offers-container {
    margin-top: 0 !important;
    width: 28% !important;
    transform: none !important;
}

.shop-categories-buttons{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.shop-categories-buttons .category-btn {
    min-width: 12rem;
    min-height: 4.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    font-size: 1.4rem;
    font-weight: bold;
    color: #fff;
    --btn-main-color: #72102c;
    --btn-main-rgb: 114, 16, 44;
    --btn-border-light: #ab133f;
    --btn-border-dark: #ab133f;
    border: 1px solid var(--btn-border-light) !important;
    letter-spacing: 0.8px;
}

.shop-categories-buttons .category-btn.category-active {
    --btn-main-color: #72102c;
    --btn-main-rgb: 114, 16, 44;
    --btn-border-light: #ab133f;
    --btn-border-dark: #ab133f;
    color: #fff;
    font-weight: bold;
    border: none;
    border-top: 4px solid var(--btn-border-light) !important;
    border-left: 4px solid var(--btn-border-dark) !important;
    border-bottom: 4px solid var(--btn-border-dark) !important;
    border-right: 4px solid var(--btn-border-dark) !important;
}

.shop-bundles-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
    gap: 1rem;
    margin-top: 0.25rem;
    width: 100%;
    min-height: 27.5rem;
}

/* Ranks page specific: feature comparison table */
.ranks-page {
    /*
     * Scales only the main ranks bracket + table (not the Ranks/Gems tabs).
     * Matches 160% browser zoom while the browser is at 130%.
     * At 100% browser zoom, use 1.6 instead.
     */
    --ranks-ui-scale: calc(160 / 130);
    --ranks-label-col: 18rem;
    --ranks-col-width: 15rem;
    --ranks-col-gap: 2rem;
    --ranks-table-est-height: 68rem;
}

.ranks-page .shop-container {
    flex-direction: column;
    align-items: stretch;
}

.ranks-page .shop-products-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ranks-page .special-offers-container {
    width: 28%;
    margin-top: 0;
}

.ranks-comparison-container {
    width: fit-content;
    max-width: 100%;
    padding: 0.25rem;
    display: flex;
    justify-content: center;
    overflow: visible;
}

.ranks-page .ranks-comparison-container.background {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    overflow: visible;
    transform: scale(var(--ranks-ui-scale));
    transform-origin: top center;
    /* Reserve layout space for scale overflow so the site footer stays visible below */
    margin-bottom: calc((var(--ranks-ui-scale) - 1) * var(--ranks-table-est-height, 68rem));
    /* Extra space inside the main bracket around the table — edit to taste */
    --ranks-bracket-padding-y: 1rem;
    --ranks-bracket-padding-x: 4rem;
    padding: var(--ranks-bracket-padding-y) var(--ranks-bracket-padding-x);
}

.ranks-page .container {
    justify-content: flex-start;
    margin-bottom: 1.5rem;
}

.ranks-page .site-footer {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    margin-top: 1.5rem;
}


/* Gems page specific: 3x2 grid for 6 offers */
.gems-page .shop-bundles-container {
    grid-template-columns: repeat(3, 33rem);
    grid-template-rows: repeat(2, 1fr);
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    min-height: unset;
    gap: 0.75rem;
}

.gems-page .shop-bundle-card {
    border: 3px solid var(--color-border-solid);
    border-radius: 6px;
    min-height: 0;
    padding: 0.8rem 0.95rem;
}

.gems-page .shop-bundle-card .special-offer-image-box {
    width: 100%;
    max-width: 100%;
    height: 16rem;
    aspect-ratio: unset;
    overflow: visible;
    background: transparent;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.gems-page .shop-bundle-card .special-offer-image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transform: none;
    transform-origin: center center;
}

.gems-page .gem-amount {
    font-size: 1.75rem;
    margin: 0.25rem 0 0.2rem 0;
}

.gems-page .gem-label,
.gems-page .gem-bonus {
    font-size: 1.15rem;
}

.gems-page .gem-info {
    margin: 0 0 0.5rem 0;
}

.gems-page .shop-bundle-card .special-offer-buy-btn {
    min-height: 3.8rem;
    font-size: 1.2rem;
    padding: 0.5rem 0.9rem;
}

/* Shared border styling for both tab panels */
#content-ranks,
#content-gems {
    --card-border-radius: 6px;
    --card-border-width: 3px;
    border-color: #821032;
}

/* Gem image background on front page special offer cards */
.gem-product .special-offer-image-box {
    background: transparent;
}

/* Gem offer card styling for special offers */
.gem-amount {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-text);
    margin: 0.5rem 0 0.3rem 0;
    font-family: 'MinecraftBold', 'Roboto', sans-serif;
}

.gem-info {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    margin: 0 0 0.8rem 0;
    gap: 0.5rem;
}

.gem-label {
    font-size: 1.4rem;
    color: #888;
    font-family: 'MinecraftBold', 'Roboto', sans-serif;
    font-weight: normal;
    line-height: 1.2;
}

.gem-bonus {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--color-green);
    font-family: 'MinecraftBold', 'Roboto', sans-serif;
    line-height: 1.2;
}

.ranks-table {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 100%;

    /* ── Ranks table layout (column sizes inherit from .ranks-page) ── */
    --ranks-bracket-width: 100%;
    --ranks-bracket-height: 4.5rem;

    /* ── Rank 1 image (left column / lowest tier) ── */
    --rank-1-image-size: 17.25rem;           /* frame width */
    --rank-1-image-visible-height: 17.25rem; /* rendered image height */
    --rank-1-image-offset-x: 0rem;           /* push image left/right — negative = left */
    --rank-1-image-offset-y: 3rem;           /* push image down — does not move the buy button */
    --rank-1-image-scale: 1.23;               /* zoom */
    --rank-1-image-overlap-btn: 0rem;          /* tuck under buy btn — btn covers image (e.g. 0.5rem) */

    /* ── Rank 2 image (middle column) ── */
    --rank-2-image-size: 17.25rem;
    --rank-2-image-visible-height: 17.25rem;
    --rank-2-image-offset-x: -1.8rem;
    --rank-2-image-offset-y: 0rem;
    --rank-2-image-scale: 1.0;
    --rank-2-image-overlap-btn: 0rem;

    /* ── Rank 3 image (right column / highest tier) ── */
    --rank-3-image-size: 17.25rem;
    --rank-3-image-visible-height: 17.25rem;
    --rank-3-image-offset-x: 0rem;
    --rank-3-image-offset-y: 0rem;
    --rank-3-image-scale: 1;
    --rank-3-image-overlap-btn: 0rem;

    /* ── Buy button text ── */
    --ranks-buy-btn-font-size: 1.3rem;
}

/* Per-rank image overrides (maps config above onto each column) */
.ranks-header .rank-column-1 {
    --ranks-image-size: var(--rank-1-image-size);
    --ranks-image-visible-height: var(--rank-1-image-visible-height);
    --ranks-image-offset-x: var(--rank-1-image-offset-x);
    --ranks-image-offset-y: var(--rank-1-image-offset-y);
    --ranks-image-scale: var(--rank-1-image-scale);
    --ranks-image-overlap-btn: var(--rank-1-image-overlap-btn);
}

.ranks-header .rank-column-2 {
    --ranks-image-size: var(--rank-2-image-size);
    --ranks-image-visible-height: var(--rank-2-image-visible-height);
    --ranks-image-offset-x: var(--rank-2-image-offset-x);
    --ranks-image-offset-y: var(--rank-2-image-offset-y);
    --ranks-image-scale: var(--rank-2-image-scale);
    --ranks-image-overlap-btn: var(--rank-2-image-overlap-btn);
}

.ranks-header .rank-column-3 {
    --ranks-image-size: var(--rank-3-image-size);
    --ranks-image-visible-height: var(--rank-3-image-visible-height);
    --ranks-image-offset-x: var(--rank-3-image-offset-x);
    --ranks-image-offset-y: var(--rank-3-image-offset-y);
    --ranks-image-scale: var(--rank-3-image-scale);
    --ranks-image-overlap-btn: var(--rank-3-image-overlap-btn);
}

.ranks-header {
    display: grid;
    grid-template-columns: var(--ranks-label-col) repeat(3, var(--ranks-col-width));
    column-gap: var(--ranks-col-gap);
    margin-bottom: 0.35rem;
    width: fit-content;
    max-width: 100%;
    overflow: visible;
}

.rank-column {
    width: 100%;
    min-width: 0;
    padding: 0.15rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: relative;

    /* fallbacks if a column class is missing */
    --ranks-image-size: 17.25rem;
    --ranks-image-visible-height: 17.25rem;
    --ranks-image-offset-x: 0rem;
    --ranks-image-offset-y: 0rem;
    --ranks-image-scale: 1;
    --ranks-image-overlap-btn: 0rem;
}

.rank-image {
    width: var(--ranks-image-size);
    align-self: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
    flex-shrink: 0;
    padding-top: var(--ranks-image-offset-y);
    /* offset-y adds height — cancel it so buy buttons stay aligned across ranks */
    margin-bottom: calc(-1 * (var(--ranks-image-overlap-btn, 0rem) + var(--ranks-image-offset-y, 0rem)));
}

.rank-image img {
    width: auto;
    height: var(--ranks-image-visible-height, var(--ranks-image-size));
    max-width: none;
    object-fit: contain;
    object-position: center bottom;
    transform: translate(var(--ranks-image-offset-x, 0rem), 0) scale(var(--ranks-image-scale));
    transform-origin: center bottom;
}

.rank-buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--ranks-bracket-height);
    min-height: var(--ranks-bracket-height);
    box-sizing: border-box;
    font-size: var(--ranks-buy-btn-font-size);
    font-weight: bold;
    color: #fff;
    padding: 0.35rem 0.5rem;
    margin-top: calc(-1 * var(--ranks-image-overlap-btn, 0rem));
    letter-spacing: 0.5px;
    line-height: 1.1;
    border-width: 2px;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.feature-row {
    display: grid;
    grid-template-columns: var(--ranks-label-col) repeat(3, var(--ranks-col-width));
    column-gap: var(--ranks-col-gap);
    align-items: center;
    margin-bottom: 0.45rem;
    width: fit-content;
    max-width: 100%;
}

.feature-row > *:first-child {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.feature-row:nth-child(even) {
    background: none;
}

.feature-name {
    padding: 0 0.5rem 0 0;
    font-size: 1.38rem;
    font-weight: bold;
    font-family: inherit;
    letter-spacing: 0.35px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
}

/* Feature name buttons - styled like server IP button */
.feature-name-btn {
    --btn-main-color: #72102c;
    --btn-main-rgb: 114, 16, 44;
    --btn-border-light: #ab133f;
    --btn-border-dark: #ab133f;
    background: var(--btn-main-color);
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.8rem 1rem;
    border: none;
    border-top: 4px solid var(--btn-border-light);
    border-left: 4px solid var(--btn-border-dark);
    border-bottom: 4px solid var(--btn-border-dark);
    border-right: 4px solid var(--btn-border-dark);
    border-radius: 2px;
    cursor: default;
    box-shadow: none;
    text-decoration: none;
    overflow: hidden;
    display: inline-block;
    text-align: center;
    font-family: inherit;
    margin: 0 auto;
    width: auto;
    max-width: 90%;
}

/* Perk value brackets in the ranks table — uniform size under each rank column */
.perk-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: var(--ranks-bracket-height);
    min-height: var(--ranks-bracket-height);
    box-sizing: border-box;
    font-size: 1.35rem;
    font-weight: bold;
    font-family: inherit;
    letter-spacing: 0.3px;
    text-align: center;
    padding: 0.25rem 0.4rem;
    background: color-mix(in srgb, var(--color-background) 55%, #55303B 45%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.perk-cell.perk-number {
    color: var(--color-green);
}

.perk-cell.perk-number.perk-vip-white {
    color: #fff;
}

.perk-cell.perk-check,
.perk-cell.perk-cross {
    font-size: 2.35rem;
    font-weight: 900;
    line-height: 1;
    font-family: 'Segoe UI Symbol', 'Arial Black', 'MinecraftBold', sans-serif;
    -webkit-text-stroke: 0.85px currentColor;
    paint-order: stroke fill;
}

.perk-cell.perk-check {
    color: var(--color-green);
}

.perk-cell.perk-check.perk-svip-white {
    color: #fff;
}

.perk-cell.perk-cross {
    color: #c62828;
}

/* Responsive for ranks page */
@media (max-width: 1100px) {
    .ranks-page {
        --ranks-label-col: 9rem;
        --ranks-col-width: 12.75rem;
        --ranks-col-gap: 1.5rem;
    }

    .ranks-table {
        --ranks-bracket-height: 4.125rem;
    }

    .ranks-header {
        grid-template-columns: var(--ranks-label-col) repeat(3, var(--ranks-col-width));
    }
    
    .feature-row {
        grid-template-columns: var(--ranks-label-col) repeat(3, var(--ranks-col-width));
    }
    
    .rank-image {
        width: var(--ranks-image-size);
    }

    .rank-image img {
        height: var(--ranks-image-visible-height, var(--ranks-image-size));
    }
    
    .feature-name {
        font-size: 1.15rem;
        white-space: normal;
    }

    .perk-cell {
        font-size: 1.2rem;
    }

    .perk-cell.perk-check,
    .perk-cell.perk-cross {
        font-size: 2rem;
        -webkit-text-stroke: 0.7px currentColor;
    }

    .rank-buy-btn {
        font-size: calc(var(--ranks-buy-btn-font-size) * 0.9);
    }
}

@media (max-width: 768px) {
    .ranks-table {
        display: block;
    }
    
    .ranks-header {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .ranks-header-spacer {
        display: none;
    }
    
    .rank-column {
        border-left: none;
        border-bottom: 1px solid var(--color-border-solid);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .feature-row {
        display: block;
        padding: 0.8rem 1rem;
        width: 100%;
    }

    .feature-name {
        font-weight: bold;
        margin-bottom: 0.6rem;
        padding: 0;
    }

    .perk-cell {
        display: inline-flex;
        width: var(--ranks-col-width, 12.75rem);
        height: var(--ranks-bracket-height, 4.125rem);
        min-height: var(--ranks-bracket-height, 4.125rem);
        margin: 0.25rem 0.25rem 0.25rem 0;
        vertical-align: top;
    }

    .rank-buy-btn {
        width: 100%;
        max-width: var(--ranks-col-width, 12.75rem);
    }
}

/* Gem offer card styling */
.gem-amount {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-text);
    margin: 0.5rem 0 0.3rem 0;
    font-family: 'MinecraftBold', 'Roboto', sans-serif;
}

.gem-info {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    margin: 0 0 0.8rem 0;
    gap: 0.5rem;
}

.gem-label {
    font-size: 1.4rem;
    color: #888;
    font-family: 'MinecraftBold', 'Roboto', sans-serif;
    font-weight: normal;
    line-height: 1.2;
}

.gem-bonus {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--color-green);
    font-family: 'MinecraftBold', 'Roboto', sans-serif;
    line-height: 1.2;
}

.shop-bundle-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--color-background);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 0.25rem;
    min-height: 26.5rem;
    border: 2px solid var(--color-border-solid);
}

.shop-bundle-card:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(var(--color-primary-rgb), 0.3);
}

.shop-bundle-card .special-offer-image-box {
    width: 100%;
    max-width: 92%;
    margin-bottom: 0.6rem;
}

/* ── Gem image scale & offset — edit the numbers below ── */
/* translateX(+right / -left)  translateY(+down / -up)    scale(size) */
.gems-page .shop-bundle-card .special-offer-image-box {
    align-items: center;
}

.gems-page .shop-bundle-card:nth-child(-n+3) .special-offer-image-box img {
    transform: translateX(5px) scale(2.0); /* top 3 */
}

.gems-page .shop-bundle-card:nth-child(n+4) .special-offer-image-box img {
    transform: translateX(0px) scale(1.5); /* bottom 3 */
}

.shop-bundle-card .special-offer-image-box img {
    object-fit: contain;
}


.shop-bundle-card h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.45rem;
}

.shop-bundle-card .offer-feature-list {
    margin: 0.35rem 0 0.75rem;
}

.special-offers-header {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: 0;
    background-color: var(--btn-main-color, #72102c);
    border: 4px solid var(--btn-border-light, #ab133f);
    margin: 0 auto 0.75rem auto;
    width: 65%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    --btn-main-color: #72102c;
    --btn-main-rgb: 114, 16, 44;
    --btn-border-light: #ab133f;
    --btn-border-dark: #ab133f;
}

.shop-container .special-offers-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.75rem;
    min-height: 46rem;
}

.shop-container .special-offer-card {
    min-height: 22rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.85rem;
    background: var(--color-background);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--color-border-solid);
}

.shop-container .special-offer-card .special-offer-image-box {
    width: 100%;
    max-width: 85%;
    margin-bottom: 0.5rem;
}

.shop-container .special-offer-card .special-offer-image-box img {
    object-fit: contain;
}

.shop-container .special-offer-card h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}

.shop-container .special-offer-card .offer-feature-list {
    margin: 0.2rem 0 0.4rem;
    font-size: 0.9rem;
}

.shop-bundle-card .special-offer-buy-btn,
.shop-container .special-offer-card .special-offer-buy-btn {
    width: 100%;
    margin-top: 0.5rem;
    font-weight: bold;
    font-size: 1.2rem;
    min-height: 3.8rem;
    padding: 0.8rem 1.2rem;
    color: #fff;
    --btn-main-color: #72102c;
    --btn-main-rgb: 114, 16, 44;
    --btn-border-light: #ab133f;
    --btn-border-dark: #ab133f;
    position: relative;
    z-index: 1;
}

@media (max-width: 1200px) {
    .shop-container {
        flex-direction: column;
        gap: 1rem;
    }

    .shop-products-container,
    .shop-container > .special-offers-container {
        width: 100% !important;
    }

    .shop-container .special-offers-items {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        min-height: 46rem;
    }
}

@media (max-width: 1100px) {
    .shop-bundles-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        min-height: 55rem;
    }
    
    /* Gems page responsive */
    .gems-page .shop-bundles-container {
        grid-template-columns: repeat(2, minmax(0, 30rem));
        grid-template-rows: repeat(3, 1fr);
        min-height: unset;
    }

    .shop-container .special-offers-items {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        min-height: 92rem;
    }

    .shop-categories-buttons {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .shop-bundles-container {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 1fr);
        min-height: 82.5rem;
    }
    
    /* Gems page mobile */
    .gems-page .shop-bundles-container {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 1fr);
        min-height: unset;
    }

    .shop-container .special-offers-items {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        min-height: 92rem;
    }
}

/* ── Tab switch animations ── */
@keyframes tabExitFade {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes tabEnterDown {
    from { opacity: 0; translate: 0 -12px; }
    to   { opacity: 1; translate: 0 0; }
}
.tab-exiting {
    animation: tabExitFade 0.13s ease forwards;
    pointer-events: none;
}
.tab-entering-down {
    animation: tabEnterDown 0.2s ease forwards;
}