/* Star tile: explicit 32x32 SVG so points stay sharp (tiny viewBox tiles look like dots). */
.coins-old-glory-card,
html.theme-old-glory {
    --og-star: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2096%2096'%3E%3Cpolygon%20fill='%23ffffff'%20fill-opacity='0.55'%20points='48,22%2053.84,39.97%2072.73,39.97%2057.44,51.07%2063.28,69.03%2048,57.93%2032.72,69.03%2038.56,51.07%2023.27,39.97%2042.16,39.97'/%3E%3C/svg%3E");
    /* 13 stripes top to bottom, viewport-locked so the count never changes. */
    --og-stripe: calc(100vh / 13);
}
.coins-old-glory-card__inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.coins-old-glory-card__flag {
    position: relative;
    width: 88px;
    height: 58px;
    flex-shrink: 0;
    overflow: hidden;
    background: repeating-linear-gradient(
        to bottom,
        #bf0a30 0,
        #bf0a30 4.46px,
        #f8f0e3 4.46px,
        #f8f0e3 8.92px
    );
}
.coins-old-glory-card__flag::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 40%;
    height: 54%;
    background-color: #002868;
    background-image: var(--og-star);
    background-size: 13px 13px;
    background-repeat: repeat;
    background-position: 0 0;
}
.coins-old-glory-card__title {
    margin: 0 0 4px;
    font-size: 1.25rem;
    color: #002868;
}
.coins-old-glory-card__price {
    margin: 0 0 8px;
    font-weight: 700;
}
.coins-old-glory-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}
.coins-old-glory-card__actions form {
    display: inline;
    margin: 0;
}
.coins-old-glory-card__actions a:not(.coins-old-glory-card__unlock) {
    color: #002868;
}
.coins-old-glory-card__unlock {
    background: #e96f26;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.coins-old-glory-card__error {
    color: #bf0a30;
    font-weight: 600;
}
.coins-skin-section .coins-skin-steps {
    margin-bottom: 18px;
    grid-template-columns: 1fr;
}
.coins-skin-shop {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
}
.coins-skin-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    background: #fff;
}
.coins-skin-card .coins-section-copy {
    margin: 0;
    font-size: 16px;
}
.coins-skin-card .coins-old-glory-card__title {
    margin: 0 0 2px;
    font-size: 1.15rem;
}
.coins-skin-card__state {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}
.coins-skin-card__state--preview {
    color: #b45309;
}
.coins-skin-card__state--active {
    color: #15803d;
}
.coins-skin-card__owned {
    font-weight: 700;
}
.coins-skin-card .coins-old-glory-card__actions {
    margin-top: auto;
}
.coins-skin-soon {
    max-width: 720px;
    margin: 16px auto 0;
    font-style: italic;
}
.coins-skin-shop__reset {
    max-width: 720px;
    margin: 12px auto 0;
    text-align: left;
}
.coins-skin-shop__reset-btn {
    background: none;
    border: 1px solid #bbb;
    border-radius: 6px;
    padding: 6px 12px;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}
.tn-old-glory-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 16px 10px;
    font-size: 12px;
}
.tn-old-glory-toggle form {
    display: inline;
    margin: 0;
}
.tn-old-glory-toggle__btn {
    background: none;
    border: none;
    padding: 4px 2px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-decoration: none;
}
.tn-old-glory-toggle__btn.is-active {
    font-weight: 700;
    color: #002868;
}
.tn-old-glory-toggle__sep {
    color: inherit;
}
html.dark-mode .coins-old-glory-card__title,
html.dark-mode .tn-old-glory-toggle__btn.is-active {
    color: var(--dm-text-primary, #f1f5f9);
}
html.dark-mode .coins-old-glory-card__price,
html.dark-mode .coins-old-glory-card .coins-section-copy,
html.dark-mode .coins-old-glory-card__actions a:not(.coins-old-glory-card__unlock),
html.dark-mode .tn-old-glory-toggle,
html.dark-mode .tn-old-glory-toggle__btn {
    color: var(--dm-text-secondary, #bbb);
}
html.dark-mode .coins-old-glory-card .coins-section-copy.coins-old-glory-card__error {
    color: #f87171;
}
html.dark-mode .coins-old-glory-card__unlock {
    color: #fff;
}
html.dark-mode .coins-skin-card {
    background: var(--dm-bg-elevated, #1f2430);
    border-color: rgba(255, 255, 255, 0.14);
}
html.dark-mode .coins-skin-card__state,
html.dark-mode .coins-skin-card__owned,
html.dark-mode .coins-skin-soon,
html.dark-mode .coins-skin-shop__reset-btn {
    color: var(--dm-text-secondary, #bbb);
}
html.dark-mode .coins-skin-card__state--preview {
    color: #fbbf24;
}
html.dark-mode .coins-skin-card__state--active {
    color: #4ade80;
}
html.dark-mode .coins-skin-shop__reset-btn {
    border-color: rgba(255, 255, 255, 0.25);
}

/* Chrome: rails + header wings. Desktop only. */
@media (min-width: 1025px) {
    html.theme-old-glory::before,
    html.theme-old-glory::after {
        content: "";
        position: fixed;
        top: 0;
        bottom: 0;
        width: max(0px, calc((100% - 1280px) / 2));
        pointer-events: none;
        z-index: 0;
        opacity: 0.55;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: 100% 100%;
        mask-size: 100% 100%;
    }
    html.theme-old-glory::before {
        left: 0;
        background-color: #002868;
        background-image: var(--og-star), var(--og-star);
        background-size: 172px 172px, 172px 172px;
        background-position: 0 0, 86px 86px;
        background-repeat: repeat;
        -webkit-mask-image: linear-gradient(to right, #000 0%, #000 58%, transparent 100%);
        mask-image: linear-gradient(to right, #000 0%, #000 58%, transparent 100%);
    }
    html.theme-old-glory::after {
        right: 0;
        background: repeating-linear-gradient(
            to bottom,
            #bf0a30 0,
            #bf0a30 var(--og-stripe),
            #f8f0e3 var(--og-stripe),
            #f8f0e3 calc(var(--og-stripe) * 2)
        );
        -webkit-mask-image: linear-gradient(to left, #000 0%, #000 58%, transparent 100%);
        mask-image: linear-gradient(to left, #000 0%, #000 58%, transparent 100%);
    }
    html.theme-old-glory #wrapper_front,
    html.theme-old-glory #main-content {
        position: relative;
        z-index: 1;
    }
    html.theme-old-glory .tn-header__navbar,
    html.theme-old-glory .tn-header__navbar.scroll-down,
    html.theme-old-glory .tn-header__navbar.scroll-up,
    html.theme-old-glory .tn-header.scroll-down .tn-header__navbar,
    html.theme-old-glory .tn-header.scroll-up .tn-header__navbar {
        display: flex !important;
        align-items: stretch;
        overflow: visible;
    }
    html.theme-old-glory .tn-header__navbar::before,
    html.theme-old-glory .tn-header__navbar::after {
        content: "";
        flex: 1 1 0;
        min-width: 0;
        pointer-events: none;
        align-self: stretch;
        opacity: 0.55;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: 100% 100%;
        mask-size: 100% 100%;
    }
    html.theme-old-glory .tn-header__navbar::before {
        background-color: #002868;
        background-image: var(--og-star);
        background-size: 116px 116px;
        background-position: left center;
        background-repeat: repeat-x;
        -webkit-mask-image: linear-gradient(to right, #000 0%, #000 58%, transparent 100%);
        mask-image: linear-gradient(to right, #000 0%, #000 58%, transparent 100%);
    }
    html.theme-old-glory .tn-header__navbar::after {
        background: repeating-linear-gradient(
            to bottom,
            #bf0a30 0,
            #bf0a30 var(--og-stripe),
            #f8f0e3 var(--og-stripe),
            #f8f0e3 calc(var(--og-stripe) * 2)
        );
        -webkit-mask-image: linear-gradient(to left, #000 0%, #000 58%, transparent 100%);
        mask-image: linear-gradient(to left, #000 0%, #000 58%, transparent 100%);
    }
    html.theme-old-glory .tn-header__navbar .tn-header__container {
        flex: 0 0 auto;
        position: relative;
        z-index: 1;
        margin-left: 0;
        margin-right: 0;
    }
}
