/* Main styles for the game */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4c6ef5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 20px;
    color: #333;
    font-weight: bold;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body {
    background-color: #f5f3ff;
    display: flex;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}

.game-container {
    max-width: 1000px;
    width: 100%;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header {
    text-align: center;
    padding: 10px;
    background-color: #4c6ef5;
    color: white;
    border-radius: 10px;
}

.instructions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.instructions button {
    padding: 12px 25px;
    font-size: 18px;
    background-color: #36c759;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.instructions button:hover {
    background-color: #2aa147;
}

.audio-button {
    width: 50px !important;
    height: 50px;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #4c6ef5 !important;
}

.audio-button:hover {
    background-color: #3b5be0 !important;
}

.audio-button .audio-icon {
    font-size: 24px;
}

.audio-button.muted .audio-icon:before {
    content: '🔇';
}

.game-area {
    min-height: 100px;
    border-radius: 10px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    font-size: 20px;
}

.baskets-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 40px;
    flex-wrap: wrap;
}

.basket {
    flex: 1;
    min-width: 300px;
    text-align: center;
    padding: 15px;
    border-radius: 15px;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.basket h2 {
    margin-bottom: 15px;
    color: #333;
}

.basket-img {
    width: 150px;
    margin-bottom: 10px;
}

.basket-img img {
    width: 100%;
    height: auto;
}

.items-container {
    width: 100%;
    min-height: 200px;
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.names-basket {
    background-color: #e9f5ff;
}

.meanings-basket {
    background-color: #fff5e9;
}

.name-item, .meaning-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    border-radius: 10px;
    width: 100%;
    text-align: center;
    font-size: 20px;
    cursor: move;
    transition: transform 0.2s, box-shadow 0.2s;
}

.name-item {
    background-color: #4c6ef5;
    color: white;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(76, 110, 245, 0.3);
}

.meaning-item {
    background-color: #ff9f43;
    color: white;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(255, 159, 67, 0.3);
}

.meaning-item.drag-over {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 159, 67, 0.7);
    background-color: #ffb366;
    transition: all 0.2s ease;
    border: 2px dashed #ff8c1a;
    animation: pulse 1.5s infinite;
}

/* Style for when dragging is happening to highlight potential drop targets */
.is-dragging-active .meaning-item:not(.matched):hover {
    transform: scale(1.03);
    box-shadow: 0 0 10px rgba(255, 159, 67, 0.5);
    transition: all 0.2s ease;
    border: 2px dotted #ff8c1a;
}

.name-item.is-dragging, .meaning-item.is-dragging {
    opacity: 0.8;
    transform: scale(1.05);
    z-index: 100;
}

.name-item.matched, .meaning-item.matched {
    outline: 3px solid #36c759;
    background-color: #ccf5d8;
    color: #333;
    cursor: default;
}

.feedback-container {
    text-align: center;
    min-height: 60px;
    font-size: 24px;
    font-weight: bold;
    color: #36c759;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .baskets-container {
        flex-direction: column-reverse;
        gap: 20px;
    }
    
    .basket {
        min-width: 100%;
    }
}
