:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --accent: #FFE66D;
    --bg-start: #fdfbfb;
    --bg-end: #ebedee;
    --text: #2b2d42;
    --card-bg: rgba(255, 255, 255, 0.85);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
}

/* Start Screen */
#start-screen {
    justify-content: center;
}

.start-box {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
    border: 3px solid white;
}

.start-box h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px white;
}

.start-box p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #666;
}

.start-box input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-family: 'Cairo', sans-serif;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s;
    text-align: center;
}

.start-box input:focus {
    border-color: var(--secondary);
}

.start-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-family: 'Cairo', sans-serif;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-box button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

/* Lesson Screen */
header {
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}

#welcome-message {
    font-size: 2.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    background: rgba(0,0,0,0.1);
    padding: 10px 30px;
    border-radius: 20px;
    display: inline-block;
}

.container {
    width: 100%;
    max-width: 1000px;
}

#cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding-bottom: 40px;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 4px solid white;
    position: relative;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    border-color: var(--accent);
}

.card-img-wrapper {
    height: 200px;
    width: 100%;
    overflow: hidden;
    background: #eee;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.word-side {
    text-align: center;
    flex: 1;
}

.word-ar {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 5px;
}

.word-en {
    font-size: 1.2rem;
    font-family: 'Nunito', sans-serif;
    color: #888;
    font-weight: bold;
}

.separator {
    font-size: 2rem;
    color: var(--secondary);
    padding: 0 10px;
}

/* Sound animation indicator */
.playing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 15px rgba(78, 205, 196, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(78, 205, 196, 0); }
}

@media (max-width: 600px) {
    .word-ar { font-size: 1.5rem; }
    .word-en { font-size: 1rem; }
    .card-img-wrapper { height: 150px; }
    #welcome-message { font-size: 1.8rem; }
}
