html, body{
    display: flex;
    flex-direction: column;
    height: 100dvh;
    justify-content: space-between;
    min-height: 100vh;
    align-items: stretch;
    overflow: hidden;
    margin: 0;
    padding: 0;
}
body{
    background-color: var(--bg-color);
    color: var(--text-color);
}
:root{
    --bg-color:#ffffff;
    --text-color:#111111;
    --key-bg:#eaeaea;
}

[data-theme="dark"]{
    --bg-color:#121212;
    --text-color:#f5f5f5;
    --key-bg:#494949;
}
*{
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

header{
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 6px 0 6px 0;
}

.hidden{
    opacity: 0;
}
.overlay-background{
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height:100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay-content{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f7e0b4;
    color: black;
    font-size: 1.1rem;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
    opacity: 1;
    transition: opacity 0.5s ease;
}
.error-message{
    position: absolute;
    left: 300px;
    max-width: fit-content;
    height: 50px;
    padding: 2px;
}
.error-message.overlay-content{
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.error-message.overlay-content.hidden{
    opacity: 0;
}
.overlay-button{
    background-color: #e0c99e;
    margin-top: 20px;
    padding: 10px 20px;
    border-width: 2px;
    border-color: black;
    border-radius: 10px;
    color: rgb(0, 0, 0);
    cursor: pointer;
    font-size: 1rem;
}

.grid-square{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 6dvh;
    max-width: 60px;
    aspect-ratio: 1/1;
    font-size: 2.0rem;
    margin: 2px;
    background-color: var(--key-bg);
    border: #3d2333 solid;
    border-width: 2px;
    font-family: "Inter", sans-serif;
    font-weight: 700;
    color: var(--text-color);
    position: relative;
}

.grid-square:hover{
    cursor: pointer;
}

.grid-row{
    display:flex;
    flex-direction: row;
    justify-content: center;
    width: 250px;
    position: relative;
    margin-left: auto;
    margin-right: auto;
}
#arrow-img{
    width: 44px;
    height: 44px;
    position: absolute;
    top: 50%;
    left:-44px;
    transform: translateY(-50%);
}

footer{
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 4px;
    text-align: left;
    width: 100%;
    box-sizing: border-box; 
}

#main{
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#keyboard{
    margin-top: 30px;
}

.keyboard-row{
    display: flex;
    justify-content: center;
    width: 60vw;
    max-width: 500px;
    margin: 0 auto;
}

.key{
    flex-grow: 1;
    margin: 2px;
    height: 8vh;
    min-height: 30px;
    max-height: 50px;
    min-width: 14px;
    width:auto;
    border: 1px solid black;
    font-size: 1.5rem;
    font-family: "Inter", sans-serif;
    font-weight: 700;
    background-color: var(--key-bg);
    color: var(--text-color);
}
.key:focus{
    outline: none;
}




footer span{
    font-size:0.75rem;
}

.green-box {
    background-color: green; 
    border-color: green;
    color: white;        
}
.yellow-box {
    background-color: #FFD700; 
    border-color: #FFD700;
    color: white;        
}
.gray-box {
    background-color: gray; 
    border-color: gray;
    color: white;        
}

.color-box {
    display: inline-block; 
    width: 20px;         
    height: 20px;         
    border-radius: 4px;  
}

.gray {
    background-color: gray;
}

.yellow {
    background-color: #FFD700;
}

.green {
    background-color: green;
}

.page-switch{
    padding: 5px;
    border: 3px solid orange;
    background-color: orange;
    font-style: normal;
    border-radius: 2px;
    color: white;
    text-decoration: none;
    z-index: 10;
}

#cloud-img{
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: -1;
    top: 3px;
}

#cloud-div{
    position: absolute;
    left: 50%;
    bottom: 110%;
    width: 140px;
    height:90px;
    transform:translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    box-sizing: border-box;
    padding: 10px;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
#cloud-div.show{
    opacity: 1;
    visibility: visible;
}

#cloud-text{
    color: black;
    font-size: 0.85rem;
    line-height: 1.2;
    text-align: center;
    width: 100%;
    max-width: 105px;
    padding-bottom: 15px;
    white-space: normal;
    word-wrap: break-word;
    padding-bottom: 16px;
    z-index: 1;
    position: relative;
}

#answer{
    font-weight: 800;
    font-size: 1.5rem;
}

.nav-logo{
    width: 38px;
    height: 38px;
}

#wordle-h1{
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin: 8px 0;
    text-align: center;
    align-items: center;
}
.header-hint p{
    font-size: 1rem;
    margin: 4px 0;
}


#hint-box{
    color: #666;
    margin: 2px 0;
    text-align: center;
}

#hint-letter{
    text-align: center;
    margin-top: 5px;
}
@media (max-width: 480px) and (max-height:1080px) {
    #wordle-h1{
        margin-top: 15px;
    } 
    .header-hint{
        margin-top: 40px;
    }
    header{
        padding: 5px;
    }
    #guide-page{
        font-size: 1.3rem;
    }
    div#guide-page h2{
        margin-top: 40px;
    }
    div#guide-page ul li{
        margin-top: 5vw;
    }
    .overlay-content{
        max-width: 90vw;
    }

    .error-message{
        position: absolute;
        top: 0;
        left: 0;
    }

    .grid-square{
        aspect-ratio: 1/1;
        height: auto;
        font-size: 2.2rem;
        width: 8.0dvh;
        max-width: 46px;
    }

    .grid-row{
        width: 80vw;
        max-width: 300px;
    }


    #keyboard{
        margin-top: 8vh;
        margin-bottom: 40px;
    }

    .keyboard-row{
        width: 95vw;
    }
    .key{
        max-height: 60px;
        height: 6vh;
        font-size: 1.35rem;
        padding: 3px;
        min-width: 28px;
    }

    .page-switch{
        top: 10px;
        left: 10px;
    }

    footer{
        left: 2px;
        bottom: 2px;
    }
}
@media (max-width:360px) , (max-height:620px){
    #main{
        margin-bottom: 15px;
        flex-grow: 1;
        flex-shrink: 1;
        min-height: 0;
        height: auto;
        max-height: 60vh;
    }
    .grid-square{
        font-size: 1.6rem;
        max-width: 38px;
        width: 14dvh;
        aspect-ratio: 1/1;
        height: auto;
    }
    .key{
        font-size: 1.1rem;
        height: 4vh;
        max-height: 45px;
        padding: 2px;
        min-width: 20px;
    }
    header{
        font-size: 0.85rem;
        margin-top: 5px;
        padding: 1px;
    }
    .page-switch{
        top: 4px;
        left: 4px;
    }
    #keyboard{
        width: 100%;
        max-width: 90dvw;
        margin-top: 10px;
        padding-bottom: 10px;
    }
}
#dark-mode-button{
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #8f8f8f; 
    border-radius: 3px;
    border: 2px solid #666;
}
#finish-div{
    margin-top: 10px;
    display: flex;
}
#finish-div-message{
    font-weight: 700;
    font-size: larger;
}
.star-image{
    width: 24px;
    height: 24px;
    aspect-ratio: 1/1;
    object-fit: cover;
}

#button-group{
    position: absolute;
    top: 20px;
    left: 20px;
    gap: 10px;
    display: flex;
    flex-direction: column;
}
#daily-mode-button{
    padding: 4px 0px;
    color: white;
    border-radius: 3px;
    background-color: darkred;
}