* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1976d2;
    --primary-light: #bbdefb;
    --secondary: #4fc3f7;
    --success: #4caf50;
    --error: #f44336;
    --bg: linear-gradient(135deg, #bbdefb 0%, #e3f2fd 50%, #e1bee7 100%);
    --card-bg: #fff;
    --text: #333;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    min-height: 100vh;
}

.skills-container {
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-template-rows: auto 1fr;
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

.skills-header {
    grid-column: 1/-1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 15px 30px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 25px;
    background: var(--primary-light);
    transition: all 0.3s;
}

.back-btn:hover {
    background: var(--primary);
    color: white;
}

.program-title {
    font-size: 1.5rem;
    color: var(--primary);
}

.program-title i {
    margin-left: 10px;
}

.level-indicator {
    background: var(--secondary);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 700;
}

.activity-area {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

.instructions-card {
    background: var(--card-bg);
    padding: 20px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.instructions-card h2 {
    color: var(--primary);
    margin-bottom: 10px;
}

.instructions-card h2 i {
    margin-left: 10px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.score-card {
    background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 5px 20px rgba(255, 179, 0, 0.3);
}

.score-card i {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.progress-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 15px;
    background: #e0e0e0;
    border-radius: 10px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #1e88e5 100%);
    border-radius: 10px;
    transition: width 0.5s;
}

.stars-earned {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stars-earned .star {
    font-size: 2rem;
    color: #e0e0e0;
    transition: all 0.3s;
}

.stars-earned .star.active {
    color: #ffc107;
    animation: starPop 0.5s;
}

@keyframes starPop {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

.memory-grid {
    display: grid;
    gap: 20px;
    max-width: 100%;
    width: 100%;
    justify-content: center;
}

.memory-grid.mode-match {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 100%;
}

.memory-card {
    width: 100px;
    height: 100px;
    background: var(--primary-light);
    border-radius: 18px;
    cursor: pointer;
    perspective: 1000px;
    transition: transform 0.3s ease;
}

.mode-match .memory-card {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}

.memory-card.flipped .card-inner,
.memory-card.matched .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    border-radius: 15px;
}

.card-front {
    background: linear-gradient(135deg, var(--primary) 0%, #1e88e5 100%);
    color: white;
}

.card-back {
    background: white;
    transform: rotateY(180deg);
    font-size: 3rem;
    border: 3px solid var(--primary-light);
}

.memory-card.matched .card-back {
    background: #c8e6c9;
    border-color: var(--success);
}

@media(max-width:900px) {
    .skills-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .sidebar>* {
        flex: 1;
        min-width: 120px;
    }
}