
html {
    height: 100%;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f8ff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    color: #333;
    -webkit-text-size-adjust: 100%;
}

#game-container {
    background-color: #ffffff;
    padding: 10px 10px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 800px;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

header h1 {
    color: #007bff;
    margin-bottom: 5px;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

#instruction {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    color: #555;
    margin-bottom: 15px;
    min-height: 2.4rem;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: clamp(10px, 2vmin, 20px);
    justify-items: center;
    align-items: center;
    margin: 0 auto 20px;
    width: 100%;
    max-width: 500px;
}

.card {
    width: 100%;
    padding-top: 100%; 
    position: relative;
    border: 3px solid #ddd;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

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

.card.correct {
    border-color: #28a745;
    animation: bounce 0.5s;
}

.card.incorrect {
    border-color: #dc3545;
    animation: shake 0.5s;
}

.vowel-card {
    width: 100%;
    padding-top: 100%; 
    position: relative;
    border: 4px solid #007bff;
    border-radius: 15px;
    font-size: clamp(3rem, 12vmin, 5rem);
    font-weight: 700;
    color: #ff4500;
    background-color: #fff8e1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.vowel-card > span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#feedback {
    font-size: clamp(1rem, 2vmin, 1.2rem);
    font-weight: 600;
    min-height: 10px;
    margin-bottom: 5px;
}

#feedback.correct {
    color: #28a745;
}

#feedback.incorrect {
    color: #dc3545;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

#score-board {
    font-size: clamp(1rem, 2.2vmin, 1.2rem);
    font-weight: 600;
    display: flex;
    gap: 5px;
}

#new-game-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 10px;
    border-radius: 8px;
    font-size: clamp(0.9rem, 2vmin, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

#new-game-button:hover {
    background-color: #0056b3;
}

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

@keyframes shake {
    0%, 100% {transform: translateX(0);}
    10%, 30%, 50%, 70%, 90% {transform: translateX(-5px);}
    20%, 40%, 60%, 80% {transform: translateX(5px);}
}


@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 0;
    }

    #game-container {
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 15px;
        box-shadow: none;
        justify-content: space-around;
    }
    
    header h1 {
        font-size: 1.6rem;
    }

    #instruction {
        font-size: 1.2rem;
    }

    #game-board {
        max-width: 450px;
        gap: 15px;
    }
    
    .vowel-card {
        font-size: 4rem;
    }

    #score-board {
        font-size: 1rem;
    }

    #new-game-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        margin-bottom: 5px;
    }
    
    #instruction {
        margin-bottom: 5px;
    }

    #game-board {
        margin-bottom: 5px;
    }

    .card {
        border-width: 2px;
        border-radius: 10px;
    }
    
    .vowel-card {
        border-width: 3px;
        border-radius: 10px;
    }

    #feedback {
        margin-bottom: 5px;
    }

    footer {
        flex-direction: column;
        gap: 15px;
        padding-top: 15px;
    }

    #score-board {
        width: 100%;
        justify-content: space-around;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    #game-container {
        padding: 10px;
        min-height: 0;
        height: 100vh;
        flex-direction: row;
        align-items: center;
        gap: 15px; 
        width: 100vw; 
    }
    
    header {
      
        display: none; 
    }
    
    main {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
        max-width: 70%; 
    }
    
    #instruction {
        display: block; 
        font-size: 1rem;
        margin-bottom: 5px;
        min-height: 1.2rem;
    }

    #game-board {
        margin: 5px auto;
        gap: 1.5vmin; 
        max-width: 400px;
    }

    .vowel-card, .card {
        font-size: clamp(2rem, 8vmin, 4rem);
    }
    
    footer {
        flex-direction: column;
        justify-content: center;
        border-top: none;
        padding-top: 0;
        gap: 10px;
        height: 100%;
        max-width: 30%; 
    }
    
    #score-board {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    #new-game-button {
     
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}