/**
 * PlayLabs Wordsearch Game CSS
 * File: assets/css/wordsearch-game.css
 */

/* Reset and Base */
.playlabs-wordsearch-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    margin: 20px 0;
    clear: both;
}

.playlabs-wordsearch-wrapper * {
    box-sizing: border-box;
}

/* Container */
.wordsearch-container {
    background: transparent;
    padding: 0;
    max-width: 100%;
}

/* Header */
.wordsearch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #0e152b;
    border-bottom: 1px solid #1e293b;
}

.header-title {
    color: #cbd5e1;
    font-size: 18px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-actions .stat-item {
    color: #cbd5e1;
    font-size: 14px;
}

.header-actions .timer {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: #1f2b56;
    padding: 4px 8px;
}

.btn-restart {
    padding: 6px 12px;
    background: #0b1226;
    color: #cbd5e1;
    border: 1px solid #1e293b;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-restart:hover {
    border-color: #334155;
    background: #121a35;
}

/* Main Layout */
.wordsearch-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 14px;
}

/* Grid Section */
.wordsearch-left {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.grid-wrapper {
    position: relative;
    display: inline-block;
    /* Add padding to account for grid border if needed */
}

.ws-cell {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: #373939;
    border: 1px solid #fff;
    color: #C39439;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ws-cell.hover {
    outline: 2px solid #7dd3fc;
    background: #1e3a5f;
}

.ws-cell.found {
    background: rgba(34, 197, 94, 0.35);
    color: #10b981;
    border-color: #16a34a;
}

/* SVG Overlay */
.grid-overlay {
    position: absolute;
    inset: 0; /* Changed from 3px to 0 since gap is now 0 */
    pointer-events: none;
}

.line {
    stroke: #3b82f6;
    stroke-width: 6;
    stroke-linecap: round;
    opacity: 0.9;
}

.found-line {
    stroke: #16a34a;
    stroke-width: 8;
    stroke-linecap: round;
    opacity: 0.9;
}

/* Word List Section */
.wordsearch-right {
    height: fit-content;
    position: sticky;
    top: 12px;
}

.wordsearch-right h2 {
    margin: 0 0 8px;
    color: #cbd5e1;
    font-size: 16px;
}

.word-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 3px;
}

.word-item {
    padding: 6px 8px;
    border: none;
    color: #cbd5e1;
    font-size: 14px;
    transition: all 0.2s;
}

.word-item.found {
    color: #10b981;
    text-decoration: line-through;
    background: rgba(16, 185, 129, 0.08);
}

/* Sponsor Section */
.wordsearch-sponsor {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #1e293b;
}

.wordsearch-sponsor img {
    max-width: 100%;
    height: auto;
    opacity: 0.8;
}

/* Win Popup */
.playlabs-wordsearch-wrapper .win-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100000;
    backdrop-filter: blur(3px);
}

.playlabs-wordsearch-wrapper .win-popup.show {
    opacity: 1;
    visibility: visible;
}

.playlabs-wordsearch-wrapper .popup-content {
    border-radius: 0 !important;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    backdrop-filter: blur(3px);
    background: transparent !important;
    overflow: hidden;
    border: 1px solid #fff;
}

.playlabs-wordsearch-wrapper .popup-content .popup-image {
    position: relative;
    z-index: 6;
}

.playlabs-wordsearch-wrapper .popup-content:after {
    content: "";
    background: #000;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(5px);
    opacity: 0.2;
    z-index: 5;
}

.playlabs-wordsearch-wrapper .win-popup.show .popup-content {
    transform: scale(1);
}

.playlabs-wordsearch-wrapper .popup-content h2 {
    color: #FFF;
    margin: 0 0 16px 0;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
}

.playlabs-wordsearch-wrapper .popup-content .popup-inner {
    margin-top: 1rem;
    position: relative;
    z-index: 6;
}

.playlabs-wordsearch-wrapper .popup-content p {
    color: #666666;
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

.playlabs-wordsearch-wrapper .popup-content .pop-second{
    font-size: 5.2rem;
    line-height: 1;
}

.playlabs-wordsearch-wrapper .popup-content .pop-third{
    font-size: 1.3rem;
    line-height: 1;
}

/* Final Stats */
.final-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
    padding: 16px;
    background: #0b1226;
    border: 1px solid #2d3748;
}

.final-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.final-stats .stat label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
}

.final-stats .stat span {
    font-size: 20px;
    font-weight: bold;
    color: #7dd3fc;
}

/* Player Name Section */
.player-name-section {
    margin: 20px 0;
    text-align: left;
}

.player-name-section label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.player-name-section input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #2d3748;
    background: #0b1226;
    color: #cbd5e1;
    font-size: 14px;
}

.player-name-section input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Popup Buttons */
.popup-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.btn {
    padding: 10px 20px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #475569;
    color: white;
}

.btn-secondary:hover {
    background: #334155;
}

/* Scrollbar Styling */
.word-list::-webkit-scrollbar {
    width: 6px;
}

.word-list::-webkit-scrollbar-track {
    background: #0b1226;
}

.word-list::-webkit-scrollbar-thumb {
    background: #334155;
}

.word-list::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wordsearch-layout {
        grid-template-columns: 1fr;
    }

    .wordsearch-right {
        position: static;
        max-width: 100%;
    }

    .ws-cell {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .header-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 550px) {
    .ws-cell {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .wordsearch-layout {
        padding: 10px;
    }

    .final-stats .stats-grid {
        grid-template-columns: 1fr;
    }

    .popup-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Updated Wordsearch CSS with Integrated Stats Bar */

/* Container - Remove header completely */
.wordsearch-container {
    background: transparent;
    padding: 0;
    max-width: 100%;
}

/* Main Layout - Side by side */
.wordsearch-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
}

/* Left: Grid Section */
.wordsearch-left {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.grid-wrapper {
    position: relative;
    display: inline-block;
    /* Add padding to account for grid border if needed */
}

/* Start Overlay */
.grid-wrapper .start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.grid-wrapper .btn-start {
    background: #fff;
    color: #A24A16;
    padding: 12px 24px;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grid-wrapper .btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(162, 74, 22, 0.3);
}

/* Countdown Overlay */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    backdrop-filter: blur(2px);
}

.countdown-number {
    font-size: 120px;
    font-weight: 900;
    color: #A24A16;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    user-select: none;
    line-height: 1;
    font-family: "Jersey 10", Sans-serif;
}

/* Countdown Animations */
@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes countdownExit {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Right: Combined Word List and Stats */
.wordsearch-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 250px;
    max-width: 270px;
}

/* Word List Bar */
.wordlist-bar {
    background: #A24A16;
    border: 3px solid #ffffff;
    padding: 12px;
}

.wordlist-bar h2 {
    display: none;
}

.word-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 3px;
}

.word-item {
    padding: 6px 8px;
    border: none;
    color: #cbd5e1;
    font-size: 14px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.word-item.found {
    color: #10b981;
    text-decoration: line-through;
    background: rgba(16, 185, 129, 0.08);
}

/* Integrated Game Stats Bar (matching external stats style) */
.wordsearch-right .game-stats {
    background: #ffffff;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0;
}

/* Stats Groups */
.wordsearch-right .playlabs-stat-group {
    display: flex;
    align-items: stretch;
    height: 70px;
}

/* Time Group */
.wordsearch-right .playlabs-time-group {
    grid-column: 1;
    grid-row: 1;
}

.wordsearch-right .playlabs-time-group .playlabs-stat-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5px;
    width: 100%;
    border: 0;
    background: #fff;
    color: #A24A16;
    text-transform: uppercase;
    font-weight: 800;
    min-height: 70px;
}

.wordsearch-right .playlabs-time-group .playlabs-time-display {
    font-weight: 800;
    color: #A24A16;
    background: #fff;
    font-size: 1.7rem;
}

.wordsearch-right .playlabs-time-group label {
    font-size: 13px;
    margin: 0;
    color: #A24A16;
    text-transform: uppercase;
    font-weight: 800;
}

/* Share Group */
.wordsearch-right .playlabs-share-group {
    grid-column: 2;
    grid-row: 1;
}

.wordsearch-right .playlabs-share-btn {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    width: 100%;
    border: 0;
    background: #fff;
    color: #A24A16;
    text-transform: uppercase;
    font-weight: 800;
    min-height: 70px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wordsearch-right .playlabs-share-btn:hover {
    background: #f8f9fa;
}

/* Retry Group */
.wordsearch-right .playlabs-retry-group {
    grid-column: 3;
    grid-row: 1;
}

.wordsearch-right .playlabs-retry-btn {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    width: 100%;
    border: 0;
    background: #fff;
    color: #A24A16;
    text-transform: uppercase;
    font-weight: 800;
    min-height: 70px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wordsearch-right .playlabs-retry-btn:hover {
    background: #f8f9fa;
}

/* Sponsor Section */
.wordsearch-right .playlabs-game-howto {
    grid-column: 1 / -1;
    grid-row: 2;
    background: #fff;
    padding: 10px;
    min-height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wordsearch-right .playlabs-game-howto img {
    max-width: 100%;
    height: auto;
    opacity: 0.8;
}

/* Grid and cells remain the same */
.wordsearch-grid {
    display: grid;
    gap: 0; /* You already have this */
    touch-action: none;
    user-select: none;
    border: 3px solid #fff;
    position: relative; /* Add this */
}

.ws-cell.hover {
    outline: 2px solid #7dd3fc;
    background: #1e3a5f;
}

.ws-cell.found {
    background: rgba(34, 197, 94, 0.35);
    color: #10b981;
    border-color: #16a34a;
}

/* SVG Overlay */
.grid-overlay {
    position: absolute;
    inset: 0; /* Changed from 3px to 0 since gap is now 0 */
    pointer-events: none;
}

.line {
    stroke: #3b82f6;
    stroke-width: 6;
    stroke-linecap: round;
    opacity: 0.9;
}

.found-line {
    stroke: #16a34a;
    stroke-width: 8;
    stroke-linecap: round;
    opacity: 0.7;
}

/* Scrollbar for word list */
.word-list::-webkit-scrollbar {
    width: 6px;
}

.word-list::-webkit-scrollbar-track {
    background: #0b1226;
}

.word-list::-webkit-scrollbar-thumb {
    background: #334155;
}

.word-list::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wordsearch-layout {
        grid-template-columns: 1fr;
    }

    .wordsearch-right {
        max-width: 100%;
        width: 100%;
    }

    .wordsearch-right .game-stats {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .wordsearch-right .playlabs-stat-group {
        grid-column: 1;
    }

    .wordsearch-right .playlabs-time-group {
        grid-row: 1;
    }

    .wordsearch-right .playlabs-share-group {
        grid-row: 2;
    }

    .wordsearch-right .playlabs-retry-group {
        grid-row: 3;
    }

    .wordsearch-right .playlabs-game-howto {
        grid-row: 4;
    }

    .countdown-number {
        font-size: 80px;
    }

    .playlabs-stats-horizontal .playlabs-enhanced-layout {
        flex-direction: column;
        gap: 12px;
    }

    .playlabs-stats-vertical .playlabs-external-stats {
        max-width: 100%;
    }

    .playlabs-stats-minimal .playlabs-enhanced-layout {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 550px) {
    .ws-cell {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .countdown-number {
        font-size: 60px;
    }
}

/* Error Display for Stats */
.playlabs-stats-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin: 10px 0;
    font-size: 14px;
}

/* ===================================================
   STYLE VARIANTS
   =================================================== */

/* Horizontal Layout (Default) */
.playlabs-stats-horizontal .playlabs-enhanced-layout {
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    align-content: stretch;
}

/* Vertical Layout */
.playlabs-stats-vertical .playlabs-enhanced-layout {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.playlabs-stats-vertical .playlabs-external-stats {
    max-width: 250px;
    margin: 0 auto;
}

.playlabs-stats-vertical .playlabs-time-group .playlabs-stat-item {
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.playlabs-stats-vertical .playlabs-time-group .playlabs-time-display {
    background: transparent;
    border: none;
    padding: 0;
}

.playlabs-stats-vertical .playlabs-share-btn,
.playlabs-stats-vertical .playlabs-retry-btn {
    width: 100%;
    justify-content: center;
}

/* Minimal Layout */
.playlabs-stats-minimal .playlabs-external-stats {
    padding: 0;
    background: none;
    border-radius: 0;
    border: 0;
}

.playlabs-stats-minimal .playlabs-enhanced-layout {
    gap: 12px;
}

.playlabs-stats-minimal .playlabs-time-group .playlabs-stat-item {
    font-size: 12px;
    gap: 4px;
}

.playlabs-stats-minimal .playlabs-time-group .playlabs-stat-item label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.playlabs-stats-minimal .playlabs-time-group .playlabs-time-display {
    font-size: 14px;
    background: transparent;
    border: none;
    padding: 0;
    min-width: auto;
}

.playlabs-stats-minimal .playlabs-share-btn,
.playlabs-stats-minimal .playlabs-retry-btn {
    padding: 4px 8px;
    font-size: 12px;
}

.playlabs-stats-minimal .playlabs-explainer {
    margin-top: 10px;
    padding: 8px 12px;
}

.playlabs-stats-minimal .playlabs-explainer-content {
    font-size: 11px;
}

/* Horizontal Layout (Default) */
.playlabs-stats-horizontal .playlabs-enhanced-layout {
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    align-content: stretch;
}

/* Vertical Layout */
.playlabs-stats-vertical .playlabs-enhanced-layout {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.playlabs-stats-vertical .playlabs-external-stats {
    max-width: 250px;
    margin: 0 auto;
}

.playlabs-stats-vertical .playlabs-time-group .playlabs-stat-item {
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.playlabs-stats-vertical .playlabs-time-group .playlabs-time-display {
    background: transparent;
    border: none;
    padding: 0;
}

.playlabs-stats-vertical .playlabs-share-btn,
.playlabs-stats-vertical .playlabs-retry-btn {
    width: 100%;
    justify-content: center;
}

/* Minimal Layout */
.playlabs-stats-minimal .playlabs-external-stats {
    padding: 0;
    background: none;
    border-radius: 0;
    border: 0;
}

.playlabs-stats-minimal .playlabs-enhanced-layout {
    gap: 12px;
}

.playlabs-stats-minimal .playlabs-time-group .playlabs-stat-item {
    font-size: 12px;
    gap: 4px;
}

.playlabs-stats-minimal .playlabs-time-group .playlabs-stat-item label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.playlabs-stats-minimal .playlabs-time-group .playlabs-time-display {
    font-size: 14px;
    background: transparent;
    border: none;
    padding: 0;
    min-width: auto;
}

.playlabs-stats-minimal .playlabs-share-btn,
.playlabs-stats-minimal .playlabs-retry-btn {
    padding: 4px 8px;
    font-size: 12px;
}

.playlabs-stats-minimal .playlabs-explainer {
    margin-top: 10px;
    padding: 8px 12px;
}

.playlabs-stats-minimal .playlabs-explainer-content {
    font-size: 11px;
}


/* Tablet landscape and smaller desktops */
@media screen and (max-width: 1024px) {
    .playlabs-wordsearch-wrapper .game-title {
        font-size: 22px;
    }
}

/* Tablet portrait */
@media screen and (max-width: 768px) {
    .playlabs-wordsearch-wrapper .game-title {
        font-size: 20px;
    }

    .playlabs-wordsearch-wrapper .game-stats {
        flex-direction: column;
        gap: 12px;
    }

    .playlabs-wordsearch-wrapper .stat-item {
        justify-content: center;
    }

    .playlabs-wordsearch-wrapper .popup-content {
        padding: 24px 20px;
        margin: 20px;
    }

    .playlabs-wordsearch-wrapper .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .playlabs-wordsearch-wrapper .popup-buttons {
        flex-direction: column;
    }

    .playlabs-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }

    /* Enhanced Stats Responsive */
    .playlabs-stats-horizontal .playlabs-enhanced-layout {
        flex-direction: column;
        gap: 12px;
    }

    .playlabs-stats-vertical .playlabs-external-stats {
        max-width: 100%;
    }

    .playlabs-stats-minimal .playlabs-enhanced-layout {
        flex-direction: column;
        gap: 8px;
    }

    /* Share dropdown positioning on tablet */
    .playlabs-share-dropdown {
        left: 0;
        transform: none;
        min-width: 180px;
    }

    .playlabs-share-dropdown::before {
        left: 20px;
        transform: none;
    }

    /* Responsive countdown for tablet */
    .playlabs-wordsearch-wrapper .countdown-number {
        font-size: 80px;
    }
}

.playlabs-game-howto{
    background: #fff;
    padding: 10px;
    min-height: 70px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    width: 100%;
}

.playlabs-game-howto h5{
    font-size: 0.8rem;
    font-weight: 800;
    color: #A24A16;
    margin: 0;
}

.playlabs-game-howto p{
    font-size: 0.8rem;
    line-height: 1;
    margin: 0;
}

/* Enhanced Mobile Responsiveness - Max 550px */
@media screen and (max-width: 550px) {
    .playlabs-wordsearch-wrapper {
        margin: 10px 0;
    }

    .playlabs-wordsearch-wrapper .game-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    /* Force game board to 350px max on mobile */
    .playlabs-wordsearch-wrapper .game-board {
        max-width: 350px !important;
        max-height: 350px !important;
        width: 350px !important;
        height: 350px !important;
        margin: 0 auto;
    }

    /* Ensure game wrapper centers the board */
    .playlabs-wordsearch-wrapper .game-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    /* Adjust stats for mobile */
    .playlabs-wordsearch-wrapper .game-stats {
        padding: 10px 12px;
        gap: 10px;
        margin-bottom: 15px;
    }

    .playlabs-wordsearch-wrapper .stat-item {
        font-size: 13px;
    }

    .playlabs-wordsearch-wrapper .stat-item span {
        font-size: 14px;
        padding: 3px 8px;
        min-width: 32px;
    }

    /* Mobile buttons */
    .playlabs-wordsearch-wrapper .btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .playlabs-wordsearch-wrapper .btn-start {
        font-size: 16px;
        padding: 10px 20px;
    }

    /* Mobile popup adjustments */
    .playlabs-wordsearch-wrapper .popup-content {
        padding: 20px 15px;
        margin: 15px;
        max-width: 95%;
    }

    .playlabs-wordsearch-wrapper .popup-content h2 {
        font-size: 24px;
    }

    /* Enhanced Stats Mobile */
    .playlabs-enhanced-stats {
        max-width: 350px;
        margin: 0 auto;
    }

    .playlabs-external-stats {
        padding: 0;
    }

    .playlabs-enhanced-layout {
        flex-direction: column !important;
        gap: 10px;
    }

    .playlabs-share-btn,
    .playlabs-retry-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }

    .playlabs-time-group .playlabs-time-display {
        font-size: 14px;
    }

    .playlabs-explainer {
        margin-top: 10px;
        padding: 10px 12px;
    }

    .playlabs-explainer-content {
        font-size: 12px;
    }

    /* Share dropdown mobile */
    .playlabs-share-dropdown {
        left: 0;
        right: 0;
        transform: none;
        min-width: auto;
        margin-left: 10px;
        margin-right: 10px;
    }

    .playlabs-share-dropdown::before {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Mobile countdown */
    .playlabs-wordsearch-wrapper .countdown-number {
        font-size: 60px;
    }

    /* Notifications on mobile */
    .playlabs-notification {
        left: 5px;
        right: 5px;
        top: 5px;
        font-size: 13px;
        padding: 10px 15px;
    }
}

/* Extra small mobile devices */
@media screen and (max-width: 360px) {
    /* Force even smaller on very small screens */
    .playlabs-wordsearch-wrapper .game-board {
        max-width: 320px !important;
        max-height: 320px !important;
        width: 320px !important;
        height: 320px !important;
    }

    .playlabs-enhanced-stats {
        max-width: 320px;
    }

    .playlabs-wordsearch-wrapper .game-title {
        font-size: 16px;
    }

    .playlabs-wordsearch-wrapper .stat-item {
        font-size: 12px;
    }

    .playlabs-wordsearch-wrapper .stat-item span {
        font-size: 13px;
        padding: 2px 6px;
    }

    .playlabs-wordsearch-wrapper .countdown-number {
        font-size: 48px;
    }

    .playlabs-share-btn,
    .playlabs-retry-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .playlabs-wordsearch-wrapper .game-board {
        border-color: #000000;
        border-width: 3px;
    }

    .playlabs-wordsearch-wrapper .tile {
        border-color: #000000;
    }

    .playlabs-wordsearch-wrapper .tile:hover {
        border-color: #0000ff;
        border-width: 3px;
    }

    .playlabs-external-stats {
        border-color: transparent;
        border-width: 0;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .playlabs-wordsearch-wrapper .tile {
        transition: none;
    }

    .playlabs-wordsearch-wrapper .btn,
    .playlabs-share-btn,
    .playlabs-retry-btn {
        transition: none;
    }

    .playlabs-wordsearch-wrapper .btn:hover,
    .playlabs-share-btn:hover,
    .playlabs-retry-btn:hover {
        transform: none;
    }

    .playlabs-wordsearch-wrapper .win-popup {
        transition: opacity 0.1s ease;
    }

    .playlabs-wordsearch-wrapper .popup-content {
        transition: none;
        transform: none;
    }

    .playlabs-wordsearch-wrapper .win-popup.show .popup-content {
        transform: none;
    }

    .playlabs-notification {
        animation: none;
    }

    .playlabs-wordsearch-wrapper .game-board {
        transition: none;
    }

    .playlabs-wordsearch-wrapper .countdown-number {
        animation: none !important;
    }

    .playlabs-share-dropdown {
        animation: none;
    }

    @keyframes countdownPulse {
        0%, 100% {
            transform: none;
            opacity: 1;
        }
    }

    @keyframes countdownExit {
        0% { opacity: 1; }
        100% { opacity: 0; }
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .playlabs-wordsearch-wrapper .game-container,
    .playlabs-external-stats {
        background: none;
    }

    .playlabs-wordsearch-wrapper .game-title,
    .playlabs-stats-title {
        color: #ffffff;
    }

    .playlabs-wordsearch-wrapper .game-stats,
    .playlabs-external-stats {
        background: none;
        border-color: transparent;
    }

    .playlabs-wordsearch-wrapper .stat-item {
        color: #e0e0e0;
    }

    .playlabs-wordsearch-wrapper .stat-item label {
        color: #b0b0b0;
    }

    .playlabs-wordsearch-wrapper .stat-item span,
    .playlabs-time-display {
        background: #4c4c4c;
        color: #ffffff;
        border-color: #5c5c5c;
    }

    .playlabs-wordsearch-wrapper .popup-content {
        background: #2c2c2c;
        color: #ffffff;
    }

    .playlabs-wordsearch-wrapper .popup-content p {
        color: #b0b0b0;
    }

    .playlabs-wordsearch-wrapper .stats-grid {
        background: #3c3c3c;
        border-color: #4c4c4c;
    }

    .playlabs-wordsearch-wrapper .stats-grid .stat label {
        color: #b0b0b0;
    }

    .playlabs-wordsearch-wrapper .stats-grid .stat span {
        color: #ffffff;
    }

    .playlabs-wordsearch-wrapper .player-name-section input {
        background: #3c3c3c;
        border-color: #4c4c4c;
        color: #ffffff;
    }

    .playlabs-game-status {
        color: #b0b0b0;
    }

    .playlabs-share-dropdown {
        background: #3c3c3c;
        border-color: #4c4c4c;
    }

    .playlabs-explainer {
        background: linear-gradient(135deg, #1a1a2e, #0f0f23);
    }

    .playlabs-explainer .explainer-text {
        color: #64b5f6;
    }
}

/* Print Styles */
@media print {
    .playlabs-wordsearch-wrapper .btn,
    .playlabs-wordsearch-wrapper .win-popup,
    .playlabs-wordsearch-wrapper .start-overlay,
    .playlabs-share-btn,
    .playlabs-retry-btn,
    .playlabs-share-dropdown {
        display: none !important;
    }

    .playlabs-wordsearch-wrapper .game-container,
    .playlabs-external-stats {
        box-shadow: none;
        border: 0;
    }
}

/* Focus Styles for Accessibility */
.playlabs-wordsearch-wrapper .btn:focus,
.playlabs-wordsearch-wrapper .tile:focus,
.playlabs-share-btn:focus,
.playlabs-retry-btn:focus {
    outline: 2px solid #A24A16;
    outline-offset: 2px;
}

.playlabs-wordsearch-wrapper .player-name-section input:focus {
    outline: 2px solid #A24A16;
    outline-offset: 1px;
}

.playlabs-external-stats.playlabs-enhanced-layout {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; /* 3 equal columns for top row */
    grid-template-rows: auto auto; /* 2 rows */
    gap: 10px; /* No gaps between items */
    width: 100%;
}

/* Top 3 items - each takes one column in first row */
.playlabs-time-group {
    grid-column: 1;
    grid-row: 1;
}

.playlabs-share-group {
    grid-column: 2;
    grid-row: 1;
}

.playlabs-retry-group {
    grid-column: 3;
    grid-row: 1;
}

/* Bottom item spans all 3 columns in second row */
.playlabs-game-howto {
    grid-column: 1 / -1; /* Span from first to last column */
    grid-row: 2;
}

/* Make sure all top items have equal height */
.playlabs-stat-group {
    display: flex;
    align-items: stretch; /* Makes content fill height */
    height: 100%; /* Fill the grid cell */
}

/* Make the content inside each group fill the available space */
.playlabs-stat-item,
.playlabs-share-wrapper,
.playlabs-retry-btn {
    flex: 1; /* Fill the available width */
    display: flex;
    align-items: center;
    justify-content: center;
}



/* Higher specificity for Elementor */
.elementor .leaderbaord {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.elementor .leaderbaord table {
    min-width: 600px !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

.elementor .leaderbaord th,
.elementor .leaderbaord td {
    padding: 12px 16px !important;
    white-space: nowrap !important;
    border-right: 1px solid #ddd !important;
}

.elementor .leaderbaord th:last-child,
.elementor .leaderbaord td:last-child {
    border-right: none !important;
}

.elementor .leaderbaord thead th {
    background: #fff !important;
    font-weight: 600 !important;
    color: #333 !important;
    border-bottom: 2px solid #ddd !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.elementor .leaderbaord tbody tr {
    background: #373839 !important;
    color: #fff !important;
    border-bottom: 1px solid #555 !important;
}

.elementor .leaderbaord tbody tr:hover {
    background: #454647 !important;
}

.elementor .leaderbaord .rank {
    width: 60px !important;
}

.elementor .leaderbaord .name {
    min-width: 120px !important;
}

.elementor .leaderbaord .moves,
.elementor .leaderbaord .completion-time {
    width: 80px !important;
}

.elementor .leaderbaord .submission-date {
    min-width: 140px !important;
    font-size: 0.9em !important;
}

/* Scrollbar styling */
.elementor .leaderbaord::-webkit-scrollbar {
    height: 8px;
}

.elementor .leaderbaord::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.elementor .leaderbaord::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

/**
 * PlayLabs wordsearch Game CSS with Enhanced Stats and Social Sharing
 *
 * File: assets/css/game.css
 * WordPress plugin game styling with external stats support, responsive sizing, and social sharing
 */

/* WordPress Theme Compatibility Reset */
.playlabs-wordsearch-wrapper *,
.playlabs-game-stats-wrapper * {
    box-sizing: border-box;
}

.playlabs-wordsearch-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.4;
    margin: 20px 0;
    clear: both;
}

/* Game Container */
.playlabs-wordsearch-wrapper .game-container {
    background: #ffffff;
    border-radius: 0;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    width: auto;
    display: inline-block;
    margin: 0 auto;
    position: relative;
}

.playlabs-wordsearch-wrapper .game-title {
    color: #333333;
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
}

/* Game Stats Bar */
.playlabs-wordsearch-wrapper .game-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    border: 1px solid #e9ecef;
}

.playlabs-wordsearch-wrapper .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.playlabs-wordsearch-wrapper .stat-item label {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

.playlabs-wordsearch-wrapper .stat-item span {
    font-size: 16px;
    color: #212529;
    background: #ffffff;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    min-width: 36px;
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
}

/* ===================================================
   ENHANCED EXTERNAL STATS WITH SOCIAL SHARING
   =================================================== */

.playlabs-game-stats-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.4;
    margin: 20px 0;
    clear: both;
}

.playlabs-stats-title {
    color: #333333;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

/* Enhanced External Stats Container */
.playlabs-external-stats {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

/* Enhanced Layout */
.playlabs-enhanced-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
}

.playlabs-stat-group {
    display: flex;
    align-items: center;
    height: 70px;
}

/* Time Group */
.playlabs-time-group .playlabs-stat-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    flex-direction: column;
    padding: 5px;

    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #A24A16 !important;
    text-transform: uppercase !important;
    font-weight: 800 !important;
    min-height: 70px;

    width: 100% !important;

    display: flex;
    justify-content: center;
    align-items: center;
}

.playlabs-time-group .playlabs-stat-item label {
    font-size: 13px;
    margin: 0;

    color: #A24A16 !important;
    text-transform: uppercase !important;
    font-weight: 800 !important;
}

.playlabs-time-group .playlabs-stat-item .playlabs-time-display {
    font-weight: 800;
    color: #A24A16;
    background: #fff;
    font-size: 1.7rem;
}

/* Share Group */
.playlabs-share-group {
    position: relative;
}

.playlabs-share-wrapper {
    position: relative;
}

.playlabs-share-btn {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    width: 100% !important;

    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #A24A16 !important;
    text-transform: uppercase !important;
    font-weight: 800 !important;
    min-height: 70px;
}

.playlabs-share-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.playlabs-share-btn.active {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
}

.playlabs-share-btn .share-icon {
    font-size: 16px;
}

.playlabs-share-btn .share-text {
    font-size: 13px;
}

/* Share Dropdown */
.playlabs-share-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
    margin-top: 8px;
    min-width: 200px;
}

.playlabs-share-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.playlabs-share-dropdown.open {
    display: block;
    animation: shareDropdownSlide 0.2s ease-out;
}

@keyframes shareDropdownSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* AddToAny Styling Override */
.playlabs-share-kit {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.playlabs-share-kit a {
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
    transition: transform 0.2s ease !important;
}

.playlabs-share-kit a:hover {
    transform: scale(1.1) !important;
}

/* Retry Group */
.playlabs-retry-group .playlabs-retry-btn {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: #fff;
    color: #A24A16;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    width: 100%;

    border: 0;
    border-radius: 0;
    background: #fff;
    color: #A24A16;
    text-transform: uppercase;
    font-weight: 800;
    min-height: 70px;
}

.playlabs-retry-btn:hover {
    background: linear-gradient(135deg, #f57c00, #ef6c00);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.playlabs-retry-btn .retry-icon {
    font-size: 16px;
}

.playlabs-retry-btn .retry-text {
    font-size: 13px;
}

/* Game Status Display */
.playlabs-game-status {
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
    font-style: italic;
    width: 100%;
}

/* Explainer Section */
.playlabs-explainer {
    margin-top: 15px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 6px;
    border-left: 4px solid #2196f3;
}

.playlabs-explainer-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.playlabs-explainer .explainer-icon {
    font-size: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

.playlabs-explainer .explainer-text {
    color: #1976d2;
    font-weight: 500;
}

/* Error Display for Stats */
.playlabs-stats-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin: 10px 0;
    font-size: 14px;
}

/* ===================================================
   STYLE VARIANTS
   =================================================== */

/* Horizontal Layout (Default) */
.playlabs-stats-horizontal .playlabs-enhanced-layout {
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    align-content: stretch;
}

/* Vertical Layout */
.playlabs-stats-vertical .playlabs-enhanced-layout {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.playlabs-stats-vertical .playlabs-external-stats {
    max-width: 250px;
    margin: 0 auto;
}

.playlabs-stats-vertical .playlabs-time-group .playlabs-stat-item {
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.playlabs-stats-vertical .playlabs-time-group .playlabs-time-display {
    background: transparent;
    border: none;
    padding: 0;
}

.playlabs-stats-vertical .playlabs-share-btn,
.playlabs-stats-vertical .playlabs-retry-btn {
    width: 100%;
    justify-content: center;
}

/* Minimal Layout */
.playlabs-stats-minimal .playlabs-external-stats {
    padding: 0;
    background: none;
    border-radius: 0;
    border: 0;
}

.playlabs-stats-minimal .playlabs-enhanced-layout {
    gap: 12px;
}

.playlabs-stats-minimal .playlabs-time-group .playlabs-stat-item {
    font-size: 12px;
    gap: 4px;
}

.playlabs-stats-minimal .playlabs-time-group .playlabs-stat-item label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.playlabs-stats-minimal .playlabs-time-group .playlabs-time-display {
    font-size: 14px;
    background: transparent;
    border: none;
    padding: 0;
    min-width: auto;
}

.playlabs-stats-minimal .playlabs-share-btn,
.playlabs-stats-minimal .playlabs-retry-btn {
    padding: 4px 8px;
    font-size: 12px;
}

.playlabs-stats-minimal .playlabs-explainer {
    margin-top: 10px;
    padding: 8px 12px;
}

.playlabs-stats-minimal .playlabs-explainer-content {
    font-size: 11px;
}

/* ===================================================
   EXISTING GAME STYLES (Unchanged)
   =================================================== */

/* Buttons */
.playlabs-wordsearch-wrapper .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
    user-select: none;
    vertical-align: middle;
}

.playlabs-wordsearch-wrapper .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.playlabs-wordsearch-wrapper .btn:active {
    transform: translateY(0);
}

.playlabs-wordsearch-wrapper .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.playlabs-wordsearch-wrapper .btn-start {
    background: #fff;
    color: #A24A16;
    padding: 12px 24px;
    border-radius: 0;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.5rem;
}

.playlabs-wordsearch-wrapper .btn-restart {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
    font-weight: 500;
}

.playlabs-wordsearch-wrapper .btn-primary {
    background: linear-gradient(135deg, #A24A16, #0056b3);
    color: white;
}

.playlabs-wordsearch-wrapper .btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

/* Game Wrapper */
.playlabs-wordsearch-wrapper .game-wrapper {
    position: relative;
    display: inline-block;
    margin: 16px 0;
}

/* Game Board */
.playlabs-wordsearch-wrapper .game-board {
    position: relative;
    border: 2px solid #333333;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin: 0 auto;
    transition: width 0.3s ease, height 0.3s ease;
}

/* Tiles */
.playlabs-wordsearch-wrapper .tile {
    position: absolute;
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
    background-size: inherit;
    background-position: inherit;
    background-repeat: no-repeat;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

.playlabs-wordsearch-wrapper .tile:hover {
    border-color: #A24A16;
    border-width: 2px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.playlabs-wordsearch-wrapper .tile.empty {
    background: rgba(0, 0, 0, 0.6) !important;
    cursor: default;
    border-color: transparent;
    opacity: 1 !important;
    font-size: 0px !important;
}

.playlabs-wordsearch-wrapper .tile.empty:hover {
    border-color: transparent;
    border-width: 1px;
    box-shadow: none;
}

/* Start Overlay */
.playlabs-wordsearch-wrapper .start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 100;
    backdrop-filter: blur(2px);
}

/* Win Popup */
.playlabs-wordsearch-wrapper .win-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100000;
    backdrop-filter: blur(3px);
}

.playlabs-wordsearch-wrapper .win-popup.show {
    opacity: 1;
    visibility: visible;
}

.playlabs-wordsearch-wrapper .popup-content {
    border-radius: 0 !important;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    backdrop-filter: blur(3px);
    background: transparent !important;
    overflow: hidden;
    border: 1px solid #fff;
    text-align: center;
}

.playlabs-wordsearch-wrapper .popup-content .popup-image {
    position: relative;
    z-index: 6;
}

.playlabs-wordsearch-wrapper .popup-content .popup-image.header {
    margin: 20px 20px 0;
}
.playlabs-wordsearch-wrapper .popup-content .popup-image.fullwidth {
    width: 100%;
    position: relative;
    bottom: -7px;
}

.playlabs-wordsearch-wrapper .popup-content:after {
    content: "";
    background: #000;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(5px);
    opacity: 0.2;
    z-index: 5;
}

.playlabs-wordsearch-wrapper .win-popup.show .popup-content {
    transform: scale(1);
}

.playlabs-wordsearch-wrapper .popup-content h2 {
    color: #FFF;
    margin: 0 0 16px 0;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
}

.playlabs-wordsearch-wrapper .popup-content .popup-inner {
    margin: 1rem;
    position: relative;
    z-index: 6;
    text-align: center;
}

.playlabs-wordsearch-wrapper .popup-content p {
    color: #666666;
    font-size: 16px;
    line-height: 1.5;
}

.playlabs-wordsearch-wrapper .popup-content .pop-second{
    font-size: 5.2rem;
    line-height: 1;
}

.playlabs-wordsearch-wrapper .popup-content .pop-third{
    font-size: 1.3rem;
    line-height: 1;
}

/* Player Name Section */
.playlabs-wordsearch-wrapper .player-name-section {
    margin: 20px 0;
    text-align: left;
}

.playlabs-wordsearch-wrapper .player-name-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333333;
}

.playlabs-wordsearch-wrapper .player-name-section input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.playlabs-wordsearch-wrapper .player-name-section input:focus {
    outline: none;
    border-color: #A24A16;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Final Stats Display */
.playlabs-wordsearch-wrapper .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.playlabs-wordsearch-wrapper .stats-grid .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
}

.playlabs-wordsearch-wrapper .stats-grid .stat label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin: 0;
}

.playlabs-wordsearch-wrapper .stats-grid .stat span {
    font-size: 20px;
    font-weight: 700;
    color: #212529;
    font-family: 'Courier New', Courier, monospace;
}

/* Popup Buttons */
.playlabs-wordsearch-wrapper .popup-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Redirect Notice */
.playlabs-wordsearch-wrapper .redirect-notice {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 8px;
    border-left: 4px solid #A24A16;
}

.playlabs-wordsearch-wrapper .redirect-notice p {
    margin: 8px 0;
    color: #A24A16;
}

.playlabs-wordsearch-wrapper .redirect-notice strong {
    color: #A24A16;
}

.playlabs-wordsearch-wrapper .redirect-notice span[id$="-redirect-countdown"] {
    font-weight: bold;
    font-size: 18px;
    color: #A24A16;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    min-width: 20px;
}

.playlabs-wordsearch-wrapper .redirect-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Advanced Stats */
.playlabs-wordsearch-wrapper .advanced-stats {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    border-radius: 8px;
    border-left: 4px solid #9c27b0;
}

.playlabs-wordsearch-wrapper .advanced-stats h4 {
    margin: 0 0 12px 0;
    color: #6a1b9a;
    font-size: 16px;
    font-weight: 600;
}

.playlabs-wordsearch-wrapper .ranking-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.playlabs-wordsearch-wrapper .rank-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.playlabs-wordsearch-wrapper .rank-number {
    font-size: 24px;
    font-weight: bold;
    color: #7b1fa2;
    line-height: 1;
}

.playlabs-wordsearch-wrapper .rank-total {
    font-size: 12px;
    color: #8e24aa;
    margin-top: 2px;
}

.playlabs-wordsearch-wrapper .percentile {
    background: #ab47bc;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Notifications */
.playlabs-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 100001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInNotification 0.3s ease-out;
}

.playlabs-notification-success {
    background: #A24A16;
    color: white;
}

.playlabs-notification-error {
    background: #dc3545;
    color: white;
}

.playlabs-notification-info {
    background: #17a2b8;
    color: white;
}

@keyframes slideInNotification {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Countdown Overlay */
.playlabs-wordsearch-wrapper .countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 150;
    backdrop-filter: blur(2px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.playlabs-wordsearch-wrapper .countdown-number {
    font-size: 120px;
    font-weight: 900;
    color: #A24A16;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    user-select: none;
    line-height: 1;
}

/* Countdown Animations */
@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes countdownExit {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Theme Overrides */
.playlabs-wordsearch-wrapper .game-container {
    background: none;
    padding: 0;
    border-radius: 0;
}

.playlabs-wordsearch-wrapper .game-title {
    display: none;
}

.playlabs-wordsearch-wrapper .game-wrapper {
    margin: 0;
    padding: 0;
    border-radius: 0;
}

.playlabs-wordsearch-wrapper .start-overlay {
    border-radius: 0;
}

.playlabs-wordsearch-wrapper .game-board {
    border-radius: 0;
}

h1, h2, h3, h4, h5, h6, div, span, p, a {
    font-family: "Montserrat";
}

/* ===================================================
   RESPONSIVE DESIGN - ENHANCED
   =================================================== */

/* Tablet landscape and smaller desktops */
@media screen and (max-width: 1024px) {
    .playlabs-wordsearch-wrapper .game-title {
        font-size: 22px;
    }
}

/* Tablet portrait */
@media screen and (max-width: 768px) {
    .playlabs-wordsearch-wrapper .game-title {
        font-size: 20px;
    }

    .playlabs-wordsearch-wrapper .game-stats {
        flex-direction: column;
        gap: 12px;
    }

    .playlabs-wordsearch-wrapper .stat-item {
        justify-content: center;
    }

    .playlabs-wordsearch-wrapper .popup-content {
        margin: 20px;
    }

    .playlabs-wordsearch-wrapper .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .playlabs-wordsearch-wrapper .popup-buttons {
        flex-direction: column;
    }

    .playlabs-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }

    /* Enhanced Stats Responsive */
    .playlabs-stats-horizontal .playlabs-enhanced-layout {
        flex-direction: column;
        gap: 12px;
    }

    .playlabs-stats-vertical .playlabs-external-stats {
        max-width: 100%;
    }

    .playlabs-stats-minimal .playlabs-enhanced-layout {
        flex-direction: column;
        gap: 8px;
    }

    /* Share dropdown positioning on tablet */
    .playlabs-share-dropdown {
        left: 0;
        transform: none;
        min-width: 180px;
    }

    .playlabs-share-dropdown::before {
        left: 20px;
        transform: none;
    }

    /* Responsive countdown for tablet */
    .playlabs-wordsearch-wrapper .countdown-number {
        font-size: 80px;
    }
}

.playlabs-game-howto{
    background: #fff;
    padding: 10px;
    min-height: 70px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    width: 100%;
}

.playlabs-game-howto h5{
    font-size: 0.8rem;
    font-weight: 800;
    color: #A24A16;
    margin: 0;
}

.playlabs-game-howto p{
    font-size: 0.8rem;
    line-height: 1;
    margin: 0;
}

/* Enhanced Mobile Responsiveness - Max 550px */
@media screen and (max-width: 550px) {
    .playlabs-wordsearch-wrapper {
        margin: 10px 0;
    }

    .playlabs-wordsearch-wrapper .game-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    /* Force game board to 350px max on mobile */
    .playlabs-wordsearch-wrapper .game-board {
        max-width: 350px !important;
        max-height: 350px !important;
        width: 350px !important;
        height: 350px !important;
        margin: 0 auto;
    }

    /* Ensure game wrapper centers the board */
    .playlabs-wordsearch-wrapper .game-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    /* Adjust stats for mobile */
    .playlabs-wordsearch-wrapper .game-stats {
        padding: 10px 12px;
        gap: 10px;
        margin-bottom: 15px;
    }

    .playlabs-wordsearch-wrapper .stat-item {
        font-size: 13px;
    }

    .playlabs-wordsearch-wrapper .stat-item span {
        font-size: 14px;
        padding: 3px 8px;
        min-width: 32px;
    }

    /* Mobile buttons */
    .playlabs-wordsearch-wrapper .btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .playlabs-wordsearch-wrapper .btn-start {
        font-size: 16px;
        padding: 10px 20px;
    }

    /* Mobile popup adjustments */
    .playlabs-wordsearch-wrapper .popup-content {
        margin: 15px;
        max-width: 95%;
    }

    .playlabs-wordsearch-wrapper .popup-content h2 {
        font-size: 24px;
    }

    /* Enhanced Stats Mobile */
    .playlabs-enhanced-stats {
        max-width: 350px;
        margin: 0 auto;
    }

    .playlabs-external-stats {
        padding: 0;
    }

    .playlabs-enhanced-layout {
        flex-direction: column !important;
        gap: 10px;
    }

    .playlabs-share-btn,
    .playlabs-retry-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }

    .playlabs-time-group .playlabs-time-display {
        font-size: 14px;
    }

    .playlabs-explainer {
        margin-top: 10px;
        padding: 10px 12px;
    }

    .playlabs-explainer-content {
        font-size: 12px;
    }

    /* Share dropdown mobile */
    .playlabs-share-dropdown {
        left: 0;
        right: 0;
        transform: none;
        min-width: auto;
        margin-left: 10px;
        margin-right: 10px;
    }

    .playlabs-share-dropdown::before {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Mobile countdown */
    .playlabs-wordsearch-wrapper .countdown-number {
        font-size: 60px;
    }

    /* Notifications on mobile */
    .playlabs-notification {
        left: 5px;
        right: 5px;
        top: 5px;
        font-size: 13px;
        padding: 10px 15px;
    }
}

/* Extra small mobile devices */
@media screen and (max-width: 360px) {
    /* Force even smaller on very small screens */
    .playlabs-wordsearch-wrapper .game-board {
        max-width: 320px !important;
        max-height: 320px !important;
        width: 320px !important;
        height: 320px !important;
    }

    .playlabs-enhanced-stats {
        max-width: 320px;
    }

    .playlabs-wordsearch-wrapper .game-title {
        font-size: 16px;
    }

    .playlabs-wordsearch-wrapper .stat-item {
        font-size: 12px;
    }

    .playlabs-wordsearch-wrapper .stat-item span {
        font-size: 13px;
        padding: 2px 6px;
    }

    .playlabs-wordsearch-wrapper .countdown-number {
        font-size: 48px;
    }

    .playlabs-share-btn,
    .playlabs-retry-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .playlabs-wordsearch-wrapper .game-board {
        border-color: #000000;
        border-width: 3px;
    }

    .playlabs-wordsearch-wrapper .tile {
        border-color: #000000;
    }

    .playlabs-wordsearch-wrapper .tile:hover {
        border-color: #0000ff;
        border-width: 3px;
    }

    .playlabs-external-stats {
        border-color: transparent;
        border-width: 0;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .playlabs-wordsearch-wrapper .tile {
        transition: none;
    }

    .playlabs-wordsearch-wrapper .btn,
    .playlabs-share-btn,
    .playlabs-retry-btn {
        transition: none;
    }

    .playlabs-wordsearch-wrapper .btn:hover,
    .playlabs-share-btn:hover,
    .playlabs-retry-btn:hover {
        transform: none;
    }

    .playlabs-wordsearch-wrapper .win-popup {
        transition: opacity 0.1s ease;
    }

    .playlabs-wordsearch-wrapper .popup-content {
        transition: none;
        transform: none;
    }

    .playlabs-wordsearch-wrapper .win-popup.show .popup-content {
        transform: none;
    }

    .playlabs-notification {
        animation: none;
    }

    .playlabs-wordsearch-wrapper .game-board {
        transition: none;
    }

    .playlabs-wordsearch-wrapper .countdown-number {
        animation: none !important;
    }

    .playlabs-share-dropdown {
        animation: none;
    }

    @keyframes countdownPulse {
        0%, 100% {
            transform: none;
            opacity: 1;
        }
    }

    @keyframes countdownExit {
        0% { opacity: 1; }
        100% { opacity: 0; }
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .playlabs-wordsearch-wrapper .game-container,
    .playlabs-external-stats {
        background: none;
    }

    .playlabs-wordsearch-wrapper .game-title,
    .playlabs-stats-title {
        color: #ffffff;
    }

    .playlabs-wordsearch-wrapper .game-stats,
    .playlabs-external-stats {
        background: none;
        border-color: transparent;
    }

    .playlabs-wordsearch-wrapper .stat-item {
        color: #e0e0e0;
    }

    .playlabs-wordsearch-wrapper .stat-item label {
        color: #b0b0b0;
    }

    .playlabs-wordsearch-wrapper .stat-item span,
    .playlabs-time-display {
        background: #4c4c4c;
        color: #ffffff;
        border-color: #5c5c5c;
    }

    .playlabs-wordsearch-wrapper .popup-content {
        background: #2c2c2c;
        color: #ffffff;
    }

    .playlabs-wordsearch-wrapper .popup-content p {
        color: #b0b0b0;
    }

    .playlabs-wordsearch-wrapper .stats-grid {
        background: #3c3c3c;
        border-color: #4c4c4c;
    }

    .playlabs-wordsearch-wrapper .stats-grid .stat label {
        color: #b0b0b0;
    }

    .playlabs-wordsearch-wrapper .stats-grid .stat span {
        color: #ffffff;
    }

    .playlabs-wordsearch-wrapper .player-name-section input {
        background: #3c3c3c;
        border-color: #4c4c4c;
        color: #ffffff;
    }

    .playlabs-game-status {
        color: #b0b0b0;
    }

    .playlabs-share-dropdown {
        background: #3c3c3c;
        border-color: #4c4c4c;
    }

    .playlabs-explainer {
        background: linear-gradient(135deg, #1a1a2e, #0f0f23);
    }

    .playlabs-explainer .explainer-text {
        color: #64b5f6;
    }
}

/* Print Styles */
@media print {
    .playlabs-wordsearch-wrapper .btn,
    .playlabs-wordsearch-wrapper .win-popup,
    .playlabs-wordsearch-wrapper .start-overlay,
    .playlabs-share-btn,
    .playlabs-retry-btn,
    .playlabs-share-dropdown {
        display: none !important;
    }

    .playlabs-wordsearch-wrapper .game-container,
    .playlabs-external-stats {
        box-shadow: none;
        border: 0;
    }
}

/* Focus Styles for Accessibility */
.playlabs-wordsearch-wrapper .btn:focus,
.playlabs-wordsearch-wrapper .tile:focus,
.playlabs-share-btn:focus,
.playlabs-retry-btn:focus {
    outline: 2px solid #A24A16;
    outline-offset: 2px;
}

.playlabs-wordsearch-wrapper .player-name-section input:focus {
    outline: 2px solid #A24A16;
    outline-offset: 1px;
}

.playlabs-external-stats.playlabs-enhanced-layout {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; /* 3 equal columns for top row */
    grid-template-rows: auto auto; /* 2 rows */
    gap: 10px; /* No gaps between items */
    width: 100%;
}

/* Top 3 items - each takes one column in first row */
.playlabs-time-group {
    grid-column: 1;
    grid-row: 1;
}

.playlabs-share-group {
    grid-column: 2;
    grid-row: 1;
}

.playlabs-retry-group {
    grid-column: 3;
    grid-row: 1;
}

/* Bottom item spans all 3 columns in second row */
.playlabs-game-howto {
    grid-column: 1 / -1; /* Span from first to last column */
    grid-row: 2;
}

/* Make sure all top items have equal height */
.playlabs-stat-group {
    display: flex;
    align-items: stretch; /* Makes content fill height */
    height: 100%; /* Fill the grid cell */
}

/* Make the content inside each group fill the available space */
.playlabs-stat-item,
.playlabs-share-wrapper,
.playlabs-retry-btn {
    flex: 1; /* Fill the available width */
    display: flex;
    align-items: center;
    justify-content: center;
}



/* Higher specificity for Elementor */
.elementor .leaderbaord {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.elementor .leaderbaord table {
    min-width: 600px !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

.elementor .leaderbaord th,
.elementor .leaderbaord td {
    padding: 12px 16px !important;
    text-align: left !important;
    white-space: nowrap !important;
    border-right: 1px solid #ddd !important;
}

.elementor .leaderbaord th:last-child,
.elementor .leaderbaord td:last-child {
    border-right: none !important;
}

.elementor .leaderbaord thead th {
    background: #fff !important;
    font-weight: 600 !important;
    color: #333 !important;
    border-bottom: 2px solid #ddd !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.elementor .leaderbaord tbody tr {
    background: #373839 !important;
    color: #fff !important;
    border-bottom: 1px solid #555 !important;
}

.elementor .leaderbaord tbody tr:hover {
    background: #454647 !important;
}

.elementor .leaderbaord .rank {
    width: 60px !important;
}

.elementor .leaderbaord .name {
    min-width: 120px !important;
}

.elementor .leaderbaord .moves,
.elementor .leaderbaord .completion-time {
    width: 80px !important;
}

.elementor .leaderbaord .submission-date {
    min-width: 140px !important;
    font-size: 0.9em !important;
}

/* Scrollbar styling */
.elementor .leaderbaord::-webkit-scrollbar {
    height: 8px;
}

.elementor .leaderbaord::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.elementor .leaderbaord::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

/* Responsive Grid Adjustments */
.wordsearch-grid.mobile-grid {
    max-width: 100%;
    margin: 0 auto;
}

/* Mobile-specific cell sizing */
@media (max-width: 768px) {
    .wordsearch-grid.mobile-grid .ws-cell {
        width: calc((100vw - 40px) / var(--grid-columns, 10));
        height: calc((100vw - 40px) / var(--grid-columns, 10));
        max-width: 35px;
        max-height: 35px;
        font-size: 14px;
    }

    /* Adjust grid container for portrait layout */
    .wordsearch-layout {
        grid-template-columns: 1fr;
        gap: 0px !important;
    }

    .wordsearch-left {
        width: 100%;
        max-width: 100%;
    }

    .wordsearch-right {
        width: 100%;
        max-width: 100%;
    }

    /* Make grid scroll if needed */
    .grid-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        max-width: 100%;
    }

    .word-list{
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0px !important;
    }


    .word-list li{
        max-width: 50%;
        width: 100%;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .wordsearch-grid.mobile-grid .ws-cell {
        width: calc((100vw - 32px) / var(--grid-columns, 10));
        height: calc((100vw - 32px) / var(--grid-columns, 10));
        max-width: 32px;
        max-height: 32px;
        font-size: 12px;
    }
}

/* CSS variable for dynamic column count */
.wordsearch-grid {
    --grid-columns: 12; /* Default */
}

.wordsearch-grid.mobile-grid {
    --grid-columns: 10; /* Mobile max */
}