* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

body {
    background-color: #f0f9ff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    overflow: hidden;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: linear-gradient(135deg, #6ee7b7, #3b82f6);
    border-radius: 15px;
    color: white;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.game-area {
    margin-bottom: 20px;
}

.score-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.score-display, .level-display {
    background-color: #fef3c7;
    padding: 8px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: black; /* Added for better readability */
}

.game-board {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.word-container, .meaning-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.word-card, .meaning-card {
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    color: black; /* Added for better readability */
}

.word-card {
    background-color: #c7d2fe;
    border: 2px solid #818cf8;
}

.meaning-card {
    background-color: #bfdbfe;
    border: 2px solid #60a5fa;
}

.word-card.selected, .meaning-card.selected {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.word-card.selected {
    background-color: #a5b4fc;
    border-color: #4f46e5;
}

.meaning-card.selected {
    background-color: #93c5fd;
    border-color: #3b82f6;
}

.word-card.correct, .meaning-card.correct {
    background-color: #86efac;
    border-color: #22c55e;
    animation: correctAnimation 0.5s ease;
}

.word-card.incorrect, .meaning-card.incorrect {
    background-color: #fca5a5;
    border-color: #ef4444;
    animation: incorrectAnimation 0.5s ease;
}

@keyframes correctAnimation {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes incorrectAnimation {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.feedback-area {
    text-align: center;
    margin: 15px 0;
}

.feedback-message {
    font-size: 1.2rem;
    font-weight: bold;
    min-height: 30px;
    margin-bottom: 10px;
}

.stars-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.star {
    font-size: 2rem;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.star.earned {
    opacity: 1;
    animation: starPop 0.5s ease;
}

@keyframes starPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.button {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: black; /* Added for better readability */
}

#check-button {
    background-color: #fcd34d;
    color: black; /* Changed for better contrast */
}

#next-level-button {
    background-color: #a7f3d0;
    color: black; /* Changed for better contrast */
}

#reset-button {
    background-color: #e5e7eb;
    color: black; /* Changed for consistency */
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.button:active {
    transform: translateY(0);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.instructions {
    background-color: #f0fdf4;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid #10b981;
}

.instructions h2 {
    color: #047857;
    margin-bottom: 10px;
}

.instructions ol {
    padding-left: 25px;
}

.instructions li {
    margin-bottom: 5px;
}

footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.9rem;
    color: #6b7280;
}

footer a {
    color: #3b82f6;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .game-board {
        flex-direction: column;
    }
    
    .word-card, .meaning-card {
        min-width: 100px;
        font-size: 0.9rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .button {
        width: 100%;
        max-width: 250px;
    }
}

/* Analytics Section Styles */
.analytics-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #eef2ff;
    border-radius: 15px;
    border: 1px solid #dbeafe;
}

.analytics-section h2 {
    text-align: center;
    color: #4338ca;
    margin-bottom: 15px;
}

.analytics-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.analytics-section th, .analytics-section td {
    border: 1px solid #c7d2fe;
    padding: 8px 12px;
    text-align: left;
}

.analytics-section th {
    background-color: #a5b4fc;
    color: white;
    font-weight: bold;
}

.analytics-section tbody tr:nth-child(even) {
    background-color: #e0e7ff;
}

.analytics-section .correct-answer {
    color: #059669; /* Green */
    font-weight: bold;
}

.analytics-section .incorrect-answer {
    color: #dc2626; /* Red */
    font-weight: bold;
}