.match3-container,
.match3-container * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.match3-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 600px;
}

.match3-goals {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.match3-goal {
    position: relative;
    display: flex;
    align-items: center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.match3-goal span {
    z-index: 0;
    position: relative;
    line-height: 1;
    margin-left: -14px;
    font-size: smaller;
    padding: 6px 8px 6px 20px;
    background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
    border-radius: 0 20px 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
    font-weight: normal;
}

.match3-goal img {
    z-index: 1;
    position: relative;
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
    border-radius: 12px;
}

.match3-goal.complete span {
    background: #83fa48;
    font-weight: bold;
}

.match3-goal-text {
    font-size: 14px;
    font-weight: 800;
    color: #5a3d8a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.match3-board {
    margin: 0 auto;
    position: relative;
    touch-action: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.match3-chain-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.match3-board svg polyline {
    filter: none;
    opacity: 0.95;
}

.match3-tile {
    background: rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 3px rgba(255, 255, 255, 0.7);
    transition: transform 0.15s ease, opacity 0.15s ease;
    will-change: transform, opacity;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    -webkit-touch-callout: none;
}

@media (hover: hover) and (pointer: fine) {
    .match3-tile:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    }
}

.match3-tile.in-chain {
    outline: 3px solid #76ff03;
    outline-offset: -3px;
    box-shadow: 0 2px 10px rgba(118, 255, 3, 0.25), inset 0 2px 20px #faea35;
}

.match3-tile img {
    filter: none;
    transition: transform 0.15s ease;
    will-change: transform;
}

.match3-tile.disappearing {
    animation: disappear 0.4s ease-out forwards;
    z-index: 20;
}

.match3-tile.falling {
    animation: fall-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes disappear {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    60% {
        opacity: 0.6;
        transform: scale(1.08);
    }

    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes fall-bounce {
    0% {
        transform: translateY(-80px);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    75% {
        transform: translateY(6px);
    }

    90% {
        transform: translateY(-2px);
    }

    100% {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    .match3-tile,
    .match3-goal {
        transition: none !important;
    }

    .match3-tile.disappearing,
    .match3-tile.falling {
        animation: none !important;
    }
}

@media (max-width: 768px) {


    .match3-goal img {
        width: 32px;
        height: 32px;
    }
}