:root {
    --primary: #ff6b6b;
    --secondary: #4ecdc4;
    --accent: #ffe66d;
    --bg-color: #f7fff7;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
}

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

.screen {
    min-height: 100vh;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* Start Screen */
.start-container {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    z-index: 10;
    max-width: 90%;
    width: 400px;
    border: 5px solid var(--accent);
}

.start-container h1 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 900;
}

.start-container p {
    font-size: 1.2rem;
    color: var(--secondary);
    margin-bottom: 30px;
    font-weight: 700;
}

.input-group {
    margin-bottom: 20px;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 3px solid #ddd;
    border-radius: 10px;
    font-size: 1.2rem;
    font-family: 'Cairo', sans-serif;
    text-align: center;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.4);
}

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

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

.btn:active {
    transform: translateY(2px);
}

/* Background Animations */
.bg-shape {
    position: absolute;
    z-index: 1;
    opacity: 0.5;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 100px;
    height: 100px;
    background: var(--primary);
    border-radius: 50%;
    top: 10%;
    left: 10%;
}

.shape-2 {
    width: 80px;
    height: 80px;
    background: var(--secondary);
    top: 60%;
    right: 15%;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation-delay: -2s;
}

.shape-3 {
    width: 120px;
    height: 120px;
    background: var(--accent);
    bottom: 10%;
    left: 20%;
    border-radius: 10px;
    animation-delay: -4s;
    transform: rotate(45deg);
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* Welcome Screen */
#welcome-screen {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
}

#welcome-message {
    font-size: 4rem;
    color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    text-align: center;
}

/* Lesson Screen */
header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 20px;
    background: white;
    padding: 15px 40px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 3px dashed var(--secondary);
}

header h1 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 5px;
}

header h2 {
    color: var(--secondary);
    font-size: 1.5rem;
    font-weight: 700;
}

.shapes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    max-width: 1000px;
    padding-bottom: 40px;
}

.shape-card {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    width: 250px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-bottom: 6px solid #eee;
    position: relative;
    overflow: hidden;
}

.shape-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.shape-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    transform: scale(0);
    transition: transform 0.5s ease-out;
    z-index: 1;
    pointer-events: none;
}

.shape-card.playing::before {
    transform: scale(1);
}

.shape-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.shape-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0px 5px 5px rgba(0,0,0,0.2));
}

.shape-name-ar {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
}

.shape-name-en {
    font-size: 1.2rem;
    color: #888;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.sound-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: var(--text-color);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    z-index: 2;
    transition: transform 0.2s;
}

.shape-card:hover .sound-icon {
    transform: scale(1.1) rotate(15deg);
}

/* Animations */
.bounce {
    animation: bounce 2s infinite;
}

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

.zoom-in {
    animation: zoomIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes zoomIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .start-container {
        padding: 20px;
    }
    
    #welcome-message {
        font-size: 2.5rem;
    }
    
    .shape-card {
        width: 100%;
        max-width: 300px;
    }
}
