@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');

* {
    font-family: "Nunito", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: none;
    outline: none;
    text-decoration: none;
    transition: .2s linear;

}

html,
body {
    height: 100%;

}

.header,
.footer {
    position: fixed;
    left: 0;
    right: 0;
    height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #fff;
    z-index: 1000;
}

.header {
    top: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

}

.header .logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-align: center;
    text-shadow: 2px 2px 4px #000000;
    display: flex;
    justify-content: center;
    align-items: center;

}

.header .logo span {
    color: orangered;
    font-size: 1.5rem;
    vertical-align: middle;
    margin-left: .5rem;
    text-align: center;
}

.footer {
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);

}



.footer a img {
    width: 4rem;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 3.75rem;
    padding-bottom: 3.75rem;
}


.card {
    background: #fff;
    border-radius: 0.625rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 1200px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-header {
    position: relative;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

}

#image {
    width: 100%;
    height: auto;
    display: block;
}


.card-content {
    padding: 20px;
}




.part1,
.part2 {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
    border: .5px solid gainsboro;
    border-radius: 5px;
    justify-content: center;
    align-items: center;
    display: flex;
    height: 130px;

}

.part3 {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
    border: .5px solid gainsboro;
    border-radius: 5px;
    justify-content: center;
    align-items: center;
    display: flex;
    height: 80px;

}

#categorySelect {
    font-size: 1rem;
    padding: 5px 10px;
}




.part2 {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.consonants {
    display: flex;
    gap: 1rem;
}

.letter-box {
    width: 50px;
    height: 50px;
    border: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
        text-align: center;
    font-size: 24px;
    font-weight: bold;
    background-color: #f9f9f9;
        text-transform: uppercase;
}

.vowel {
    margin-left: 3rem;
}

.vowel-box {
    border-color: #ff0000;
}

.active-box {

    border-color: orangered;
    box-shadow: 0 0 5px orangered;
    animation: pulse-box 1s infinite;
}

@keyframes pulse-box {
    0% {
        transform: scale(1);
        box-shadow: 0 0 5px orangered;
    }

    50% {
        transform: scale(1.04);
        box-shadow: 0 0 10px orangered;
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 5px orangered;
    }
}





/* Overlay katmanı */
#countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    visibility: hidden;
}

/* Geri sayım sayısı */
#countdown-number {
    font-size: 8rem;
    color: white;
    font-weight: bold;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}




.word-boxes {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.word-boxes .letter-box {
    width: 40px;
    height: 40px;
    border: 1px solid #333;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
}


.correct-guess {
    animation: correctFlash 0.8s ease;
    background-color: #4CAF50;
    /* yeşil */
    color: white;
}

@keyframes correctFlash {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.wrong-guess {
    animation: wrongShake 0.5s ease;
    background-color: #f44336;
    /* kırmızı */
    color: white;
}

@keyframes wrongShake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}



.card-footer {
    background: #fff;
    padding: .5rem;
    text-align: center;
    border-top: .5px solid #ddd;
    box-shadow: 0px -1px 10px rgba(0, 0, 0, 0.1);

}



.card-footer button {
    display: inline-block;
    margin: .5rem;
    padding: .5rem 1.2rem;
    font-size: 1.3rem;
    color: #fff;
    background: orangered;
    cursor: pointer;
}

.card-footer button:hover {
    opacity: .85;
}

.card .card-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 0.3rem;
    color: orangered;
}




.game-message {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  z-index: 9999;
  font-family: Arial, sans-serif;
  font-size: 14px;
  animation: fadeInOut 3s forwards;
}

.game-message.error {
  background: rgba(255,0,0,0.8);
}

.game-message.success {
  background: rgba(0,128,0,0.8);
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}






/* MEDIA QUERIES  */


@media screen and (max-width: 480px) {
    .card {
        height: auto;
        max-width: 100%;
        margin: 0 10px;
    }

    .card-header img {
        max-height: 100px;
    }

    .part1,
    .part2,
    .part3 {
        flex-direction: column;
        height: auto;
        padding: .5rem;
        margin-bottom: .5rem;
    }

    .consonants {
        gap: .5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .letter-box {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .word-boxes .letter-box {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }

    .vowel {
        margin-left: 0;
        margin-top: .5rem;
    }

    #categorySelect {
        font-size: .9rem;
        padding: 4px 8px;
    }

    .card-footer button {
        font-size: 1rem;
        padding: .4rem .8rem;
        margin: .3rem;
    }

    #countdown-number {
        font-size: 4rem;
    }

    .footer a img {
        width: 2rem;
    }
}

@media screen and (min-width: 481px) and (max-width: 767px) {
    .card {
        height: auto;
        max-width: 95%;
        margin: 0 auto;
    }

    .card-header img {
        max-height: 120px;
    }

    .part1,
    .part2,
    .part3 {
        flex-direction: column;
        height: auto;
        padding: .8rem;
        margin-bottom: .8rem;
    }

    .consonants {
        gap: .8rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .letter-box {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .word-boxes .letter-box {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }

    .vowel {
        margin-left: 0;
        margin-top: 1rem;
    }

    #categorySelect {
        font-size: 1rem;
        padding: 6px 10px;
        width: 80%;
    }

    .card-footer button {
        font-size: 1.1rem;
        padding: .6rem 1rem;
        margin: .4rem;
    }

    #countdown-number {
        font-size: 6rem;
    }

    .footer a img {
        width: 2.5rem;
    }

    .card-footer button {
        padding: .5rem 1rem;
        font-size: .8rem;
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .card {
        height: auto;
        max-width: 90%;
        margin: 0 auto;
    }

    .card-header img {
        max-height: 140px;
    }

    .part1,
    .part2,
    .part3 {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        height: auto;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .consonants {
        gap: 1rem;
        justify-content: center;
    }

    .letter-box {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }

    .word-boxes .letter-box {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }

    .vowel {
        margin-left: 2rem;
    }

    #categorySelect {
        font-size: 1rem;
        padding: 8px 12px;
        width: auto;
    }

    .card-footer button {
        font-size: 1.2rem;
        padding: .6rem 1.2rem;
        margin: .5rem;
    }

    #countdown-number {
        font-size: 7rem;
    }

    .footer a img {
        width: 3rem;
    }

    .card-footer button {
        padding: .5rem 1rem;
        font-size: .9rem;
    }
}

@media screen and (min-width: 1025px) and (max-width: 1440px) {
    .card {
        height: auto;
        max-width: 80%;
        margin: 0 auto;
    }

    .card-header img {
        max-height: 180px;
    }

    .part1,
    .part2,
    .part3 {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        height: auto;
        padding: 1.2rem;
        margin-bottom: 1.2rem;
    }

    .consonants {
        gap: 1.2rem;
        justify-content: center;
    }

    .letter-box {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }

    .word-boxes .letter-box {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }

    .vowel {
        margin-left: 2.5rem;
    }

    #categorySelect {
        font-size: 1.1rem;
        padding: 10px 14px;
        width: auto;
    }

    .card-footer button {
        font-size: 1.3rem;
        padding: .8rem 1.5rem;
        margin: .6rem;
    }

    #countdown-number {
        font-size: 8rem;
    }

    .footer a img {
        width: 3.5rem;
    }

    .card-footer button {
        padding: .5rem 1rem;
        font-size: 1rem;
    }
}

@media screen and (min-width: 1441px) {
    .card {
        height: auto;
        max-width: 70%;
        margin: 0 auto;
    }

    .card-header img {
        max-height: 200px;
    }

    .part1,
    .part2,
    .part3 {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        height: auto;
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .consonants {
        gap: 1.5rem;
        justify-content: center;
    }

    .letter-box {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .word-boxes .letter-box {
        width: 55px;
        height: 55px;
        font-size: 1.8rem;
    }

    .vowel {
        margin-left: 3rem;
    }

    #categorySelect {
        font-size: 1.2rem;
        padding: 12px 16px;
        width: auto;
    }

    .card-footer button {
        font-size: 1.4rem;
        padding: 1rem 1.8rem;
        margin: .8rem;
    }

    #countdown-number {
        font-size: 9rem;
    }

    .footer a img {
        width: 4rem;
    }

    .card-footer button {
        padding: .5rem 1rem;
        font-size: 1.1rem;
    }
}