.ws-area {
    background: #fafafa;
    display: inline-block;
    border-radius: 10px;
    -moz-user-select: none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: 20px;
    /* Only prevent touch actions within the word search area */
    touch-action: pan-y; /* Allow vertical scrolling */
}

.ws-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    line-height: 0;
    margin: 0;
    padding: 0;
    touch-action: pan-y; /* Allow vertical scrolling */
}

.ws-col {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid blue;
    box-sizing: border-box;
    /* Prevent text selection but allow scrolling */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y; /* Allow vertical scrolling */
}

.ws-col.ws-selected {
    background: #eee;
}

.ws-found {
    background: #ff0;
}

.ws-game-over-outer {
    background: rgba(0, 0, 0, 0.85);
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.ws-game-over-inner {
    width: 100%;
    height: 100%;
    display: table;
    margin: 0;
    padding: 2;
}

.ws-game-over {
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    padding: 20px;
}

.ws-game-over h2 {
    color: #fff;
    font-size: 2em;
    margin: 0 0 9px;
    padding: 2;
}

.h3 {
    color: #fff;
    font-size: 1.8em;
    margin: 0 0 9px;
    padding: 2;
}

.ws-game-over p {
    color: #fff;
    font-size: 1em;
    margin: 0;
    padding: 0;
}

/* ✅ Mobile adjustments */
@media (max-width: 768px) {
    .ws-area {
        padding: 0px;
        font-size: 0.7em;
        touch-action: pan-y; /* Allow vertical scrolling */
    }

    .ws-row {
        justify-content: center;
        touch-action: pan-y; /* Allow vertical scrolling */
    }

    .ws-col {
        width: 22px;
        height: 22px;
        line-height: 22px;
        font-size: 12px;
        padding: 0;
        touch-action: pan-y; /* Allow vertical scrolling */
    }

    .ws-col.ws-selected {
        background: #d4e6ff;
    }

    .ws-found {
        background: #ffeb3b;
    }

    .ws-game-over-outer {
        padding: 10px;
    }

    .ws-game-over {
        padding: 15px;
    }

    .ws-game-over h2 {
        font-size: 1.5em;
        margin: 0 0 15px;
    }

    .ws-game-over p {
        font-size: 0.9em;
    }
}

/* Additional mobile-specific fixes for very small screens */
@media (max-width: 480px) {
    .ws-area {
        padding: 5px;
    }

    .ws-col {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 11px;
    }

    .ws-game-over h2 {
        font-size: 1.3em;
    }
}

