/* --- Match Specific Styles --- */
/* Extracted from original style.css to maintain exact visual identity */

/* Container overrides */
.panel-container {
    background-color: var(--color-bg-secondary);
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius-card);
    border: 1px solid var(--color-border);
}

/* Timer text */
#match-timer {
    color: var(--color-text-primary);
}

/* Grid Layout helpers */
#match-game-area {
    width: 100%;
}
/* Ensure lists stack properly in the grid */
#match-terms-list, #match-defs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Matches space-y-3 from tailwind */
}

/* The Card Item */
.match-item {
    background-color: var(--color-card-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-button);
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    /* Ensure items can grow in height and center text */
    min-height: 70px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
    justify-content: center; /* Center text visually */
    text-align: center;
    word-break: break-word;
}

.match-item.image-only {
    min-height: 0;
}

.match-text {
    width: 100%;
}

.match-media-slot {
    width: 100%;
    max-height: 140px;
    display: none;
    align-items: center;
    justify-content: center;
}

.match-media-slot img {
    max-height: 100%;
    width: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
}

.match-item:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background-color: var(--color-bg-secondary);
}

/* Selected State */
.match-item.selected {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 700;
}
body.light-mode .match-item.selected {
    color: var(--color-primary);
}

/* Correct Match State */
.match-item.correct {
    background-color: var(--color-correct-light);
    border-color: var(--color-correct);
    color: var(--color-correct);
    font-weight: 700;
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(0.98);
}

/* Incorrect Match State (with Shake animation) */
.match-item.incorrect {
    background-color: var(--color-incorrect-light);
    border-color: var(--color-incorrect);
    color: var(--color-incorrect);
    font-weight: 700;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Disabled/Empty text styling */
#match-mode-disabled p,
#match-complete-view p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

/* Allow body text selection on Match page while keeping header/footer non-selectable */
body {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

header, footer {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}