/* REUSABLE ARTIST TRADING CARD PRESENTATION */
.atc-token {
    width: 100%;
    margin: 10px auto 1.6em;
    font-family: DejaVuSansMono, monospace;
}

.atc-loading,
.atc-error {
    margin: 0;
    padding: 14px 10px;
    border: 1px dashed rgba(245, 241, 230, 0.26);
    background: rgba(0, 0, 0, 0.18);
    color: rgba(245, 241, 230, 0.72);
    font-size: 12px;
    text-align: center;
}

.atc-gallery-shell {
    width: min(100%, 590px);
    margin: 0 auto;
}


.atc-grid-tools {
    display: flex;
    justify-content: space-between;
    margin: 0 0 5px;
}

.atc-flip-all {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px 3px 5px;
    border: 1px solid rgba(245, 241, 230, 0.38);
    border-radius: 0;
    background: #0d0b12;
    color: rgba(245, 241, 230, 0.78);
    font-family: DejaVuSansMono, monospace;
    font-size: 10px;
    line-height: 1;
    text-transform: lowercase;
    cursor: pointer;
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.72);
}

.atc-flip-all:hover,
.atc-flip-all:focus-visible {
    color: #ffd666;
    border-color: rgba(255, 214, 102, 0.68);
    outline: none;
}

.atc-flip-all-symbol {
    display: inline-block;
    font-size: 14px;
    line-height: 0.75;
}

.atc-flip-all.will-show-fronts .atc-flip-all-symbol {
    transform: scaleX(-1);
}

.atc-scale-control {
    appearance: none;
    position: relative;
    z-index: 10002;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 23px;
    min-width: 27px;
    padding: 0;
    border: 1px solid rgba(245, 241, 230, 0.20);
    border-radius: 0;
    background: #0d0b12;
    color: rgba(245, 241, 230, 0.43);
    font-family: DejaVuSansMono, monospace;
    line-height: 1;
    cursor: pointer;
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.62);
}

.atc-scale-control:hover,
.atc-scale-control:focus-visible,
.atc-scale-control.is-pinned {
    color: rgba(245, 241, 230, 0.72);
    border-color: rgba(245, 241, 230, 0.34);
    outline: none;
}

.atc-scale-symbol {
    display: block;
    width: 1em;
    height: 1em;
    font-size: 14px;
    line-height: 0.88em;
    text-align: center;
    transform: translateY(-1px);
}

.atc-scale-dimmer {
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(5, 4, 8, 0.40);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease;
}

.atc-scale-popover {
    position: absolute;
    z-index: 10003;
    width: min(370px, calc(100vw - 20px));
    box-sizing: border-box;
    padding: 4px;
    border: 1px solid rgba(245, 241, 230, 0.30);
    background: #0b0910;
    box-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.24),
        inset 0 0 0 1px rgba(255, 214, 102, 0.025);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 100ms ease, transform 100ms ease;
}

.atc-scale-video {
    display: block;
    width: 100%;
    height: auto;
    background: #08070b;
}

.atc-scale-dimmer.is-visible,
.atc-scale-popover.is-visible {
    opacity: 1;
    visibility: visible;
}

.atc-scale-popover.is-visible {
    transform: translateY(0);
}

.atc-scale-dimmer.is-pinned {
    pointer-events: auto;
}

.atc-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(var(--atc-columns, 3), minmax(0, 1fr));
    column-gap: clamp(4px, 0.85vw, 8px);
    row-gap: clamp(5px, 1vw, 9px);
    width: 100%;
    padding: 4px;
    box-sizing: border-box;
    overflow: visible;
    perspective: 1000px;
}

.atc-card-item {
    --wave-rx: 0deg;
    --wave-ry: 0deg;
    --wave-lift: 0px;
    --wave-scale: 1;
    --preview-x: 0px;
    --preview-y: 0px;
    --preview-scale: 1;
    --preview-ui-scale: 1;
    --gloss-x: 50%;
    --gloss-y: 20%;

    position: relative;
    z-index: 1;
    min-width: 0;
    aspect-ratio: 1370 / 1905;
    transition: opacity 0.24s ease, filter 0.24s ease;
}

.atc-card-item.is-hovered {
    z-index: 20;
}

.atc-card-item.is-previewed {
    z-index: 100;
}

.atc-card-motion {
    position: relative;
    width: 100%;
    height: 100%;
    transform:
        translate3d(var(--preview-x), var(--preview-y), 0)
        scale(var(--preview-scale));
    transform-origin: center center;
    transition: transform 0.78s cubic-bezier(0.18, 0.66, 0.2, 1);
    will-change: transform;
}

.atc-card-wave {
    position: relative;
    width: 100%;
    height: 100%;
    transform:
        translate3d(0, var(--wave-lift), 0)
        rotateX(var(--wave-rx))
        rotateY(var(--wave-ry))
        scale(var(--wave-scale));
    transform-style: preserve-3d;
    transition: transform 0.22s ease-out;
    will-change: transform;
}

.atc-card-item.is-hovered .atc-card-wave {
    transform:
        translate3d(0, calc(var(--wave-lift) - 5px), 0)
        rotateX(var(--wave-rx))
        rotateY(var(--wave-ry))
        scale(calc(var(--wave-scale) + 0.035));
}

.atc-card-item.is-previewed .atc-card-wave {
    transform: none;
}

.atc-card-flip {
    appearance: none;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.atc-card-flip:focus-visible {
    outline: none;
}

.atc-card-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1.58s cubic-bezier(0.18, 0.62, 0.2, 1);
    will-change: transform;
}

.atc-card-item.is-flipped .atc-card-inner {
    transform: rotateY(180deg);
}

.atc-card-face {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    border-radius: 6% / 4.3%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
    contain: paint;
}

.atc-card-front {
    z-index: 2;
}

.atc-card-back {
    z-index: 1;
    transform: rotateY(180deg);
}

.atc-card-item.is-showing-back .atc-card-front {
    z-index: 1;
}

.atc-card-item.is-showing-back .atc-card-back {
    z-index: 2;
}

.atc-card-face img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.42));
}

.atc-card-face::after {
    content: "";
    position: absolute;
    inset: -8%;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(
            112deg,
            transparent 27%,
            rgba(255, 255, 255, 0.04) 39%,
            rgba(255, 255, 255, 0.29) 49%,
            rgba(255, 255, 255, 0.07) 58%,
            transparent 71%
        );
    background-position: calc((var(--gloss-x) - 50%) * 0.35) calc((var(--gloss-y) - 50%) * 0.2);
    transition: opacity 0.18s ease;
}

.atc-card-item.is-hovered .atc-card-face::after,
.atc-card-item.is-previewed .atc-card-face::after {
    opacity: 0.52;
}

/* Flip glint: each visible face carries its own light, so the streak stays
   clipped to the physical card throughout both directions of rotation. */
.atc-card-face::before {
    content: "";
    position: absolute;
    z-index: 5;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background-image:
        linear-gradient(
            106deg,
            transparent 0%,
            transparent 36%,
            rgba(255, 248, 212, 0.13) 42%,
            rgba(255, 255, 255, 0.78) 48%,
            rgba(255, 247, 202, 0.31) 53%,
            transparent 61%,
            transparent 100%
        );
    background-size: 72% 100%;
    background-repeat: no-repeat;
    background-position: -230% 0;
    mix-blend-mode: screen;
    filter: drop-shadow(0 0 2px rgba(255, 244, 185, 0.42));
}

.atc-card-item.is-flipping-to-back .atc-card-back::before {
    animation: atc-glint-arrive 0.62s 0.36s cubic-bezier(0.2, 0.62, 0.22, 1) both;
}

.atc-card-item.is-flipping-to-front .atc-card-front::before {
    animation: atc-glint-arrive 0.62s 0.36s cubic-bezier(0.2, 0.62, 0.22, 1) both;
}


@keyframes atc-glint-arrive {
    0%   { opacity: 0; background-position: -230% 0; }
    12%  { opacity: 0.16; }
    38%  { opacity: 0.76; }
    68%  { opacity: 0.3; }
    100% { opacity: 0; background-position: 235% 0; }
}

.atc-preview-control,
.atc-preview-close {
    appearance: none;
    position: absolute;
    z-index: 6;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(245, 241, 230, 0.5);
    border-radius: 0;
    background: #0d0b12;
    color: rgba(245, 241, 230, 0.9);
    font-family: DejaVuSansMono, monospace;
    cursor: pointer;
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
    -webkit-tap-highlight-color: transparent;
}

.atc-preview-control {
    left: 5px;
    bottom: 5px;
    width: 23px;
    height: 23px;
    opacity: 0.72;
    transition: opacity 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.atc-preview-control svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: square;
}

.atc-card-item:hover .atc-preview-control,
.atc-preview-control:focus-visible {
    opacity: 1;
    color: #ffd666;
    border-color: rgba(255, 214, 102, 0.72);
}

.atc-preview-close {
    left: 5px;
    top: 5px;
    width: 24px;
    height: 24px;
    visibility: hidden;
    opacity: 0;
    font-size: 17px;
    line-height: 1;
    transform: scale(var(--preview-ui-scale));
    transform-origin: left top;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.atc-preview-close:hover,
.atc-preview-close:focus-visible {
    color: #ffd666;
    border-color: rgba(255, 214, 102, 0.72);
}

.atc-card-item.is-previewed .atc-preview-control {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.atc-card-item.is-previewed .atc-preview-close {
    visibility: visible;
    opacity: 1;
}

.atc-token.is-previewing .atc-card-item:not(.is-previewed) {
    z-index: 0;
    opacity: 0.34;
    filter: grayscale(0.82) brightness(0.72);
    pointer-events: none;
}

.atc-info-panel {
    position: relative;
    z-index: 0;
    min-height: 116px;
    margin-top: 14px;
    padding: 10px 11px 11px;
    box-sizing: border-box;
    border: 1px solid rgba(245, 241, 230, 0.28);
    border-left: 1px solid rgba(245, 241, 230, 0.28);
    background: #100d14;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.48);
    color: rgba(245, 241, 230, 0.66);
    font-size: 12px;
    line-height: 1.5;
    transition: color 0.16s ease, border-color 0.16s ease;
}

.atc-info-panel.has-card {
    color: rgba(245, 241, 230, 0.9);
    border-color: rgba(245, 241, 230, 0.38);
    border-color: rgba(215, 179, 93, 0.48);
}

.atc-info-topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 7px;
    border-bottom: 1px dashed rgba(245, 241, 230, 0.2);
}

.atc-info-title {
    color: inherit;
    font-size: 13px;
    line-height: 1.35;
}

.atc-info-panel.has-card .atc-info-title {
    color: #ffd666;
}

.atc-info-position {
    flex: 0 0 auto;
    font-size: 10px;
    color: rgba(245, 241, 230, 0.54);
}

.atc-info-description {
    min-height: 3em;
    margin: 9px 0 7px !important;
    font-family: DejaVuSansMono, monospace;
    font-size: 15px;
    line-height: 1.5;
}

.atc-info-specs {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 0 0 8px;
    color: rgba(245, 241, 230, 0.72);
    font-size: 11px;
    line-height: 1.5;
}

.atc-info-materials {
    display: inline;
}

.atc-info-size {
    margin-left: 0.45em;
    color: rgba(245, 241, 230, 0.52);
    font-family: DejaVuSansMono, monospace;
    font-size: 0.82em;
    white-space: nowrap;
}

.atc-info-category {
    color: rgba(255, 214, 102, 0.78);
    font-size: 0.88em;
}

.atc-info-description strong,
.atc-info-description b,
.atc-info-materials strong,
.atc-info-materials b {
    color: #f5f1e6;
}

.atc-info-trade {
    padding-top: 6px;
    border-top: 1px dashed rgba(245, 241, 230, 0.18);
    color: rgba(245, 241, 230, 0.58);
    font-size: 10px;
    letter-spacing: 0.25px;
    text-transform: uppercase;
}

.atc-info-panel.has-card .atc-info-trade {
    color: rgba(255, 214, 102, 0.78);
}


@media (max-width: 700px) {
    .atc-gallery-shell {
        width: 100%;
    }

    .atc-grid {
        column-gap: 4px;
        row-gap: 5px;
        padding: 2px;
    }


    .atc-info-panel {
        min-height: 112px;
        margin-top: 11px;
        padding: 9px;
    }

    .atc-info-topline {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .atc-info-description {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .atc-card-motion,
    .atc-card-wave,
    .atc-card-inner,
    .atc-card-item,
    .atc-card-face::after,
    .atc-card-face::before {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* v9: symbol-only grid control. */
.atc-flip-all {
    min-width: 27px;
    padding-left: 6px;
    padding-right: 6px;
}

/* v10: visually center the symbol-only flip control. */
.atc-flip-all {
    width: 27px;
    height: 23px;
    min-width: 27px;
    padding: 0;
    gap: 0;
    justify-content: center;
    line-height: 1;
}

.atc-flip-all-symbol {
    display: block;
    width: 1em;
    height: 1em;
    line-height: 1em;
    text-align: center;
    transform: translateY(-1px);
}

.atc-flip-all.will-show-fronts .atc-flip-all-symbol {
    transform: translateY(-1px) scaleX(-1);
}

/* Desktop hover dock: the existing information panel temporarily leaves its slot. */
.atc-info-anchor {
    position: relative;
    margin-top: 14px;
}

.atc-info-anchor .atc-info-panel {
    margin-top: 0;
}

@media (min-width: 701px) and (hover: hover) and (pointer: fine) {
    .atc-info-anchor.is-vacant::before {
        content: "";
        position: absolute;
        inset: 0;
        box-sizing: border-box;
        border: 1px solid rgba(245, 241, 230, 0.1);
        background: rgba(0, 0, 0, 0.16);
        box-shadow:
            inset 0 1px 5px rgba(0, 0, 0, 0.52),
            inset 0 0 0 1px rgba(255, 214, 102, 0.025);
    }

    .atc-info-panel.is-hover-docked {
        position: fixed;
        z-index: 9998;
        left: var(--atc-dock-left);
        top: var(--atc-dock-top);
        width: var(--atc-dock-width);
        margin: 0;
        box-shadow:
            inset 0 0 0 1px rgba(0, 0, 0, 0.48),
            3px 4px 0 rgba(0, 0, 0, 0.5);
        pointer-events: none;
    }
}

@media (max-width: 700px) {
    .atc-info-anchor {
        margin-top: 11px;
    }
}

/* Trade status: light belongs only to the lettering, never the whole row. */
.atc-trade-text {
    display: inline-block;
    color: rgba(242, 234, 219, 0.48);
}

.atc-trade-text.is-available {
    --atc-trade-base: rgba(255, 214, 102, 0.76);
    --atc-trade-glint: rgba(255, 248, 214, 0.96);
    color: transparent;
    background-image: linear-gradient(
        105deg,
        var(--atc-trade-base) 0%,
        var(--atc-trade-base) 44%,
        var(--atc-trade-glint) 49%,
        var(--atc-trade-base) 54%,
        var(--atc-trade-base) 100%
    );
    background-size: 320% 100%;
    background-position: 115% 0;
    -webkit-background-clip: text;
    background-clip: text;
    animation: atc-trade-text-glint 12s linear infinite;
    animation-delay: var(--atc-trade-delay, 0s);
}

.atc-trade-text.is-off {
    color: rgba(242, 234, 219, 0.48);
}

.atc-trade-text.is-available {
    cursor: pointer;
}

.atc-trade-text.is-available:hover,
.atc-trade-text.is-available:active,
.atc-trade-text.is-available.is-pressed {
    --atc-trade-base: rgba(255, 229, 148, 0.94);
    --atc-trade-glint: rgba(255, 252, 231, 0.99);
    text-decoration-line: underline;
    text-decoration-thickness: 0.35px;
    text-underline-offset: 2px;
    text-decoration-color: rgba(255, 229, 148, 0.14);
}

@keyframes atc-trade-text-glint {
    from { background-position: 140% 0; }
    to   { background-position: -140% 0; }
}

/* Early-2000s guidebook callout. */
.atc-guide-box {
    position: relative;
    width: min(100%, 600px);
    margin: 2.15em auto 1.7em;
    box-sizing: border-box;
    border: 1px solid rgba(215, 179, 93, 0.56);
    background: #100d14;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.55),
        3px 3px 0 rgba(0, 0, 0, 0.38);
    font-size: 0.91em;
    line-height: 1.62;
}

.atc-guide-heading {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px 5px 42px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(215, 179, 93, 0.42);
    background: rgba(255, 214, 102, 0.08);
}

.token-body .atc-guide-heading h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.atc-guide-mark {
    position: absolute;
    top: -8px;
    left: 9px;
    width: 27px;
    height: 31px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(245, 241, 230, 0.48);
    background: #d7b35d;
    color: #141018;
    font-family: Georgia, serif;
    font-size: 25px;
    font-weight: bold;
    line-height: 1;
    transform: rotate(-4deg);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.58);
}

.atc-guide-content {
    padding: 12px 14px 13px;
}

.token-body .atc-guide-content p {
    margin: 0 0 0.95em;
}

.atc-guide-content ul {
    margin-top: -0.35em;
    margin-bottom: 1em;
}

.token-body .atc-guide-content .atc-guide-last {
    margin-bottom: 0;
    font-family: DejaVuSansMono, monospace;
    font-size: 0.94em;
}

@media (max-width: 700px) {
    .atc-guide-box {
        width: 96%;
        font-size: 0.92em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .atc-trade-text.is-available {
        animation: none;
        color: rgba(255, 214, 102, 0.78);
        background: none;
    }
}

/* Scale reference video: final responsive sizing. */
@media (max-width: 700px) {
   .atc-scale-popover {
        width: min(82vw, 320px);
    }
}
