:root {
    --square: 96px;
}

.cardholder {
    position: relative;
    width: 90%;
    max-width: 1200px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.cardholderpivot {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    width: 100%;
    min-height: 100px;
    justify-content: center;
    align-items: flex-start;
    transform-origin: center;
}

.card-text-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background-color: transparent;
    z-index: 0;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.card-text-display span {
    font-weight: 700;
    color: #404040;
    text-align: center;
    display: inline-block;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.card-text-display .text-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.card-text-display .text-slide.exit {
    transform: translate(-50%, calc(-50% - 100%)) !important;
    opacity: 0 !important;
}

.card {
    --base-width: var(--square);
    width: var(--base-width);
    height: var(--square);
    cursor: pointer;
    perspective: 1000px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.card.wide {
    --base-width: calc(var(--square) * 2);
}

.card.ultra-wide {
    --base-width: calc(var(--square) * 3);
}

.card-content {
    width: var(--base-width);
    height: var(--square);
    background: transparent;
    color: #ffffff;
    place-items: center;
    font-weight: 700;
    font-size: 32px;
    border-radius: 16px;
    flex: 0 0 auto;
    user-select: none;
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
    will-change: transform, filter;
    backface-visibility: hidden;
    overflow: hidden;
    contain: layout style paint;
    transform: translateZ(0);
}

.card-content img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    pointer-events: none;
    display: block;
    position: relative;
    z-index: 10;
    opacity: 1;
    padding: 10px;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
}

.card-image-wrapper .card-scan-line {
    position: absolute;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    will-change: opacity;
    filter: blur(1px);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform: translateZ(0);
    contain: layout style paint;
}

.card-image-wrapper .card-scan-line-top {
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.9) 20%, rgba(255, 255, 255, 0.9) 80%, transparent 100%);
    transform-origin: center;
}

.card-image-wrapper .card-scan-line-right {
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.9) 20%, rgba(255, 255, 255, 0.9) 80%, transparent 100%);
    transform-origin: center;
}

.card-image-wrapper .card-scan-line-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.9) 20%, rgba(255, 255, 255, 0.9) 80%, transparent 100%);
    transform-origin: center;
}

.card-image-wrapper .card-scan-line-left {
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.9) 20%, rgba(255, 255, 255, 0.9) 80%, transparent 100%);
    transform-origin: center;
}

.card-image-wrapper .card-grid-glow {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    border-radius: 16px;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    filter: blur(20px);
}

.card-image-wrapper .card-holographic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    will-change: opacity, background-position;
    transition: opacity 0.3s ease-out;
    padding: 10px;
    transform: translateZ(0);
    contain: layout style paint;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 0, 200, 0.9) 0%, rgba(255, 0, 200, 0.6) 25%, rgba(255, 0, 200, 0.3) 50%, transparent 70%),
        radial-gradient(circle at 70% 70%, rgba(0, 200, 255, 0.9) 0%, rgba(0, 200, 255, 0.6) 25%, rgba(0, 200, 255, 0.3) 50%, transparent 70%),
        linear-gradient(135deg, rgba(255, 0, 255, 0.7) 0%, rgba(0, 255, 255, 0.7) 20%, rgba(255, 255, 0, 0.7) 40%, rgba(255, 0, 255, 0.7) 60%, rgba(0, 255, 255, 0.7) 80%, rgba(255, 0, 255, 0.7) 100%);
    background-size: 180% 180%, 180% 180%, 250% 250%;
    background-position: 50% 50%, 50% 50%, 0% 0%;
    mix-blend-mode: difference;
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}

.card-image-wrapper .card-texture-holographic {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    pointer-events: none;
    z-index: 14;
    opacity: 0;
    will-change: opacity, background-position;
    transition: opacity 0.3s ease-out;
    transform: translateZ(0);
    contain: layout style paint;
    background-image:
        radial-gradient(circle at 30% 30%, rgba(255, 0, 200, 0.8) 0%, rgba(255, 0, 200, 0.5) 25%, rgba(255, 0, 200, 0.2) 50%, transparent 70%),
        radial-gradient(circle at 70% 70%, rgba(0, 200, 255, 0.8) 0%, rgba(0, 200, 255, 0.5) 25%, rgba(0, 200, 255, 0.2) 50%, transparent 70%),
        linear-gradient(135deg, rgba(255, 0, 255, 0.6) 0%, rgba(0, 255, 255, 0.6) 20%, rgba(255, 255, 0, 0.6) 40%, rgba(255, 0, 255, 0.6) 60%, rgba(0, 255, 255, 0.6) 80%, rgba(255, 0, 255, 0.6) 100%);
    background-size: 180% 180%, 180% 180%, 250% 250%;
    background-position: 50% 50%, 50% 50%, 0% 0%;
    background-repeat: no-repeat, no-repeat, no-repeat;
    mix-blend-mode: overlay;
    filter: brightness(1.3) contrast(1.2);
    mask-image: url('../img/texture/wave.png');
    -webkit-mask-image: url('../img/texture/wave.png');
    mask-size: 200% 200%;
    -webkit-mask-size: 200% 200%;
    mask-position: 50% 50%;
    -webkit-mask-position: 50% 50%;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    overflow: hidden;
}

.card-image-wrapper .card-grid-texture {
    position: absolute;
    top: -30%;
    left: -10%;
    width: 120%;
    height: 160%;
    border-radius: 16px;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    background-repeat: repeat;
    background-position: 0 0;
    transform: rotate(15deg);
    transform-origin: center;
    will-change: opacity;
    transition: none;
    overflow: hidden;
}

.card-image-wrapper .card-grid-holographic {
    position: absolute;
    top: -30%;
    left: -10%;
    width: 120%;
    height: 160%;
    border-radius: 16px;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.3s ease-out;
    contain: layout style paint;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 0, 200, 0.8) 0%, rgba(255, 0, 200, 0.5) 25%, rgba(255, 0, 200, 0.2) 50%, transparent 70%),
        radial-gradient(circle at 70% 70%, rgba(0, 200, 255, 0.8) 0%, rgba(0, 200, 255, 0.5) 25%, rgba(0, 200, 255, 0.2) 50%, transparent 70%);
    background-size: 200% 200%, 200% 200%;
    background-position: 50% 50%, 50% 50%;
    mix-blend-mode: screen;
    filter: blur(2px);
    transform: rotate(15deg);
    transform-origin: center;
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}


