.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-board-bg {
    overflow: hidden;
    margin: 0 auto;
    padding: 6px;

    border-style: solid;
    border-color: transparent;
    border-width: 20px;

    border-image-source: url('assets/polc.png');
    border-image-slice: 90;
    border-image-width: 20px;
    border-image-repeat: round;

    background-image:
        linear-gradient(to bottom, rgba(93, 58, 36, 0.85), rgba(44, 26, 14, 0.9)),
        url('assets/wood-texture.png');

    background-size:
        100% 100%,
        400px auto;

    background-position:
        center,
        center bottom;

    background-repeat:
        no-repeat,
        repeat;

    background-clip: padding-box;

    box-shadow: inset 0 3px 10px rgba(0, 0, 0, .4);
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.7));
}

.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: 8px;

    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;
    }
}


/* levels coloring */

.match3-board.ocean .match3-tile img {
    width: 90% !important;
    height: auto !important;
    aspect-ratio: 1/1;
}


.match3-board.ocean .match3-tile,
.match3-board.gems .match3-tile,
.match3-board.flowers .match3-tile {
    background: none;
    box-shadow: none;
}

.match3-board.ocean .match3-tile img,
.match3-board.gems .match3-tile img,
.match3-board.flowers .match3-tile img {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)) drop-shadow(0 0 6px rgba(255, 255, 255, .1));
}

.match3-board.fruits .match3-tile {
    background: #fff;
}

.match3-board.monsters .match3-tile {
    background: rgba(255, 255, 255, 0.6);
}

/* T-Rex – sárga */
.match3-board.dinosaurs .tile-a {
    background: #06A39C;
}

/* Pteranodon – narancs */
.match3-board.dinosaurs .tile-b {
    background: #F990B2;
}

/* Spinosaurus – világoskék */
.match3-board.dinosaurs .tile-c {
    background: #C89AE6;
}

/* Velociraptor – türkiz */
.match3-board.dinosaurs .tile-d {
    background: #A1BB19;
}

/* Zöld T-Rex – lime */
.match3-board.dinosaurs .tile-e {
    background: #D4258B;
}

/* Stegosaurus – lila */
.match3-board.dinosaurs .tile-f {
    background: #F89028;
}

/* Triceratops – rózsaszín */
.match3-board.dinosaurs .tile-g {
    background: #D98FA4;
}

/* Brachiosaurus – pink */
.match3-board.dinosaurs .tile-h {
    background: #C84F8C;
}

/* Parasaurolophus – menta */
.match3-board.dinosaurs .tile-i {
    background: #7FC6BE;
}