@media (max-width: 600px) {
    .game-layout {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .word-list-panel, .grid-panel, .panel-header, .game-info, .game-actions {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }
    .panel-header h2 {
        font-size: 18px !important;
    }
    .panel-header p {
        font-size: 12px !important;
    }
    .grid-cell {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }
    .game-info, .game-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .new-game-btn, .hint-btn, .reset-btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}
.word-search-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 30px;
    border-radius: 10px;
    margin: 0;
    margin-bottom: 20px;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 20px;
}

.difficulty-selector,
.theme-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.difficulty-selector label,
.theme-selector label {
    font-weight: bold;
    color: #667eea;
    font-size: 16px;
}

.difficulty-selector select,
.theme-selector select {
    padding: 8px 12px;
    font-size: 14px;
    border: 2px solid #667eea;
    border-radius: 5px;
    cursor: pointer;
    background: white;
}

.new-game-btn {
    padding: 10px 25px;
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.new-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.timer-display,
.found-display {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.timer-display span,
.found-display span {
    color: #764ba2;
}

.game-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.word-list-panel {
    width: 280px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.panel-header {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.panel-header h2 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: white;
}

.panel-header p {
    font-size: 14px;
    margin: 0;
    opacity: 0.95;
}

.word-list-panel h3 {
    color: #667eea;
    font-size: 20px;
    margin-bottom: 15px;
    text-align: center;
}

#word-list {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

#word-list li {
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    transition: all 0.3s;
}

#word-list li.found {
    background: #d4edda;
    color: #155724;
    text-decoration: line-through;
}

#word-list li.hint {
    background: #fff3cd;
    color: #856404;
    animation: pulse 1s;
}

.grid-panel {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.word-grid {
    display: inline-grid;
    gap: 3px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.grid-cell {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 22px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.grid-cell:hover {
    background: #667eea15;
    transform: scale(1.05);
}

.grid-cell.selected {
    background: #667eea;
    color: white;
}

.grid-cell.found {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.grid-cell.hint {
    background: #ffc107;
    color: #333;
    border-color: #ffc107;
    animation: blink 1s 3;
}

.ads-panel {
    width: 280px;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.ads-panel h3 {
    color: #667eea;
    font-size: 20px;
    margin-bottom: 15px;
    text-align: center;
}

.ad-box {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ad-placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.game-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.hint-btn,
.reset-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.hint-btn {
    background: #ffc107;
    color: #333;
}

.hint-btn:hover {
    background: #ffb300;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.reset-btn {
    background: #dc3545;
    color: white;
}

.reset-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.celebration-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.celebration-content h2 {
    color: #667eea;
    font-size: 42px;
    margin-bottom: 20px;
}

.celebration-content p {
    font-size: 24px;
    color: #555;
    margin-bottom: 20px;
}

.play-again-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@media (max-width: 1200px) {
    .game-layout {
        flex-wrap: wrap;
    }

    .ads-panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .game-info {
        flex-direction: column;
        align-items: stretch;
    }

    .difficulty-selector,
    .theme-selector {
        width: 100%;
        justify-content: space-between;
    }

    .new-game-btn {
        width: 100%;
    }

    .game-layout {
        flex-direction: column;
    }

    .word-list-panel {
        width: 100%;
    }

    .panel-header h2 {
        font-size: 20px;
    }

    .panel-header p {
        font-size: 12px;
    }

    .grid-cell {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .game-actions {
        flex-direction: column;
        max-width: 100%;
    }

    .hint-btn,
    .reset-btn {
        width: 100%;
    }
}