/* Card Pairs — board only */

.cp-grid {
    display: grid;
    gap: 8px;
    justify-content: center;
    padding: 10px;
    border: 1px solid rgba(111, 214, 196, 0.2);
    background: rgba(0, 0, 0, 0.35);
}

.cp-card {
    width: 70px;
    height: 84px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    perspective: 640px;
    -webkit-tap-highlight-color: transparent;
}

.cp-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.cp-card.flipped .cp-inner,
.cp-card.matched .cp-inner {
    transform: rotateY(180deg);
}

.cp-face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 3px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.cp-back {
    border: 1px solid rgba(111, 214, 196, 0.45);
    background:
        repeating-linear-gradient(45deg, rgba(111, 214, 196, 0.07) 0 6px, transparent 6px 12px),
        linear-gradient(160deg, rgba(111, 214, 196, 0.16), rgba(3, 9, 9, 0.94));
    color: rgba(111, 214, 196, 0.6);
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
}

.cp-front {
    transform: rotateY(180deg);
    border: 1px solid rgba(111, 214, 196, 0.65);
    background: rgba(111, 214, 196, 0.07);
    color: #ecf2f0;
    font-size: 2rem;
    line-height: 1;
}

.cp-card.matched {
    cursor: default;
}

.cp-card.matched .cp-front {
    border-color: rgba(74, 222, 128, 0.85);
    background: rgba(74, 222, 128, 0.14);
    color: #4ade80;
    box-shadow: inset 0 0 16px rgba(74, 222, 128, 0.18);
}

.cp-card.wrong .cp-front {
    border-color: rgba(255, 90, 90, 0.9);
    background: rgba(255, 90, 90, 0.16);
    color: #ff8a8a;
}

.cp-card:not(.matched):not(.flipped):hover .cp-back {
    border-color: rgba(111, 214, 196, 0.85);
    background:
        repeating-linear-gradient(45deg, rgba(111, 214, 196, 0.12) 0 6px, transparent 6px 12px),
        linear-gradient(160deg, rgba(111, 214, 196, 0.24), rgba(3, 9, 9, 0.94));
}

@media (max-width: 640px) {
    .cp-grid {
        gap: 5px;
        padding: 6px;
    }

    .cp-card {
        width: 54px;
        height: 66px;
    }

    .cp-front {
        font-size: 1.5rem;
    }
}
