/* === Word Connect – Betűlánc játék stílusok === */

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

.wordconnect-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* === Szólistachipek === */

.wordconnect-wordlist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 4px 0 6px;
    width: 100%;
}

.wordconnect-chip {
    padding: 6px 14px;
    border-radius: 20px;
    background: #e8eaf6;
    color: #3949ab;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    border: 2px solid #9fa8da;
    transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.2s;
    white-space: nowrap;
}

.wordconnect-chip.found {
    background: #c8e6c9;
    color: #2e7d32;
    border-color: #81c784;
    text-decoration: line-through;
    opacity: 0.8;
}

.wordconnect-chip.active {
    background: #fff9c4;
    color: #e65100;
    border-color: #ffd600;
    transform: scale(1.08);
}

/* === Élő szókijelzés === */

.wordconnect-current {
    min-height: 38px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 5px;
    color: #37474f;
    text-align: center;
    padding: 3px 18px;
    border-radius: 12px;
    transition: color 0.15s, background 0.15s;
    background: transparent;
    min-width: 160px;
}

.wordconnect-current.ok {
    color: #2e7d32;
    background: #e8f5e9;
    animation: wc-popin 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wordconnect-current.err {
    color: #c62828;
    background: #ffebee;
    animation: wc-shake 0.45s ease;
}

/* === Utasítás === */

.wordconnect-instruction {
    margin: 0;
    padding: 4px 12px;
    font-size: 13px;
    color: #546e7a;
    text-align: center;
    opacity: 0.85;
}

/* === Tábla === */

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

/* Üres hely – ahol megtalált szó volt */
.wordconnect-tile.empty {
    background: rgba(0, 0, 0, 0.06);
    border: 2px dashed rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

/* Lánc SVG vonal */
.wordconnect-chain-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* === Betűlapkák === */

.wordconnect-tile {
    background: linear-gradient(145deg, #5c6bc0, #3949ab);
    color: #ffffff;
   
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.28),
        inset 0 1px 3px rgba(255, 255, 255, 0.2);
    font-weight: 900;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    aspect-ratio: 1;
    line-height: 1;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    will-change: transform;
    -webkit-touch-callout: none;
    padding: clamp(0.75rem, 2vw, 1rem);
}

@media (hover: hover) and (pointer: fine) {
    .wordconnect-tile:hover {
        filter:
            brightness(1.1)
            saturate(1.3)
            hue-rotate(5deg);
         
    }
}

/* Láncban lévő lapka */
.wordconnect-tile.in-chain {
    background: linear-gradient(145deg, #ff8f00, #e65100);
    box-shadow:
        0 3px 14px rgba(230, 81, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: scale(1.07);
    z-index: 10;
}

/* === Animációk === */

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

.wordconnect-tile.falling {
    animation: wc-fall 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

    50% {
        opacity: 0.7;
        transform: scale(1.18);
        background: linear-gradient(145deg, #66bb6a, #388e3c);
    }

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

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

    50% {
        opacity: 1;
    }

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

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

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

@keyframes wc-popin {
    0% {
        transform: scale(0.88);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes wc-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-7px);
    }

    40% {
        transform: translateX(7px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* === Csökkentett mozgás === */

@media (prefers-reduced-motion: reduce) {
    .wordconnect-tile {
        transition: none !important;
    }

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

    .wordconnect-current {
        animation: none !important;
    }
}

/* === Mobil === */

@media (max-width: 400px) {
    .wordconnect-chip {
        font-size: 11px;
        padding: 4px 10px;
    }

    .wordconnect-current {
        font-size: 18px;
        letter-spacing: 3px;
    }
}


/* === Megtalált szó betűinek stílusa === */

.wordconnect-tile.found-tile {
    /* Zöld gradiens a sikeres találathoz */
    background: linear-gradient(145deg, #66bb6a, #2e7d32);
 
    opacity: 0.9;
   
    z-index: 1;
    cursor: default;
     
    animation: wc-success-pop 0.4s ease-out;
}

/* Sikeres találat animáció */
@keyframes wc-success-pop {
    0% {
        transform: scale(1);
        filter: brightness(1.5);
    }

    50% {
        transform: scale(1.1);
        filter: brightness(1.2);
    }

    100% {
        transform: scale(0.98);
        filter: brightness(1);
    }
}