/* Page layout */
body{
    margin:0;
    font-family: Arial, Helvetica, sans-serif;
    background:white;
    color:black;

    display:flex;
    justify-content:center;
    align-items:flex-start;
    min-height:100vh;
    padding-top:40px;
}

/* Main container */
#game{
    text-align:center;
    width:100%;
    max-width:320px;
}


#guess-row{
    margin-top:20px;
    display:flex;
    flex-direction:column;
    align-items:center;
    width:100%;
}

/* Each guess row */
.row{
    display:flex;
    justify-content:center;
    gap:4px;
    margin-bottom:6px;
    width:100%;
}


.tile{
    width:35px;
    height:35px;
    display:flex;
    justify-content:center;
    align-items:center;

    font-size:24px;
    font-weight:bold;
    color:white;
}

/* Input row */
#input-row{
    display:flex;
    justify-content:center;
    gap:5px;
    margin-top:10px;
}

/* Input tiles */
.tile-input{
    width:35px;
    height:35px;
    text-align:center;

    font-size:16px;
    font-weight:bold;
    border:2px solid #888;
    text-transform:uppercase;
    border-radius: 4px;
    caret-color: transparent;
    outline: none;
    -webkit-appearance: none;
}
.tile-input:focus {
    border: 3px solid #000;
    background-color: #f5f5f5;
}
/* Keyboard Tiles */

 .keyboard-tile {
     width: 42px;
     height: 58px;
     background-color: #d3d6da; /* Light grey from Wordle */
     border: none;
     border-radius: 4px;       /* Rounded corners */
     margin: 0 3px;            /* Horizontal gap between keys */
     display: flex;
     align-items: center;
     justify-content: center;
     font-weight: bold;
     font-size: 18px;
     font-family: inherit;
     cursor: pointer;
     color: black;
     flex-shrink: 0;
     box-sizing: border-box;
 }
#keyboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 40px;    /* Forces space below the "Response" section */
    margin-bottom: 20px;
    clear: both;
}

/* Styles the rows inside the container */
#keyboard-container > div {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 8px;  /* Vertical gap between keyboard rows */
}

@media (max-width: 480px) {

    body {
        padding-top: 16px;
        align-items: flex-start;
    }

    #game {
        max-width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }


    .tile {
        width: clamp(40px, 11vw, 52px);
        height: clamp(40px, 11vw, 52px);
        font-size: clamp(18px, 5vw, 26px);
        border-radius: 4px;
    }


    .tile-input {
        width: clamp(40px, 13vw, 52px);
        height: clamp(40px, 13vw, 52px);
        font-size: 16px;
        border-radius: 4px;
        -webkit-appearance: none;      /* removes iOS default input styling */
        caret-color: transparent;      /* hides blinking cursor in the box */
    }


    .keyboard-tile {
        width: clamp(28px, 8.5vw, 40px);
        height: 50px;
        font-size: clamp(11px, 3vw, 16px);
        margin: 0 1px;
        touch-action: manipulation;              /* removes 300ms tap delay on mobile */
        -webkit-tap-highlight-color: transparent; /* removes blue flash on tap */
    }


    #keyboard-container {
        margin-top: 24px;
        margin-bottom: 12px;
    }


    #submitButton,
    #resetButton,
    #userFeedbackButton {
        min-height: 44px;
        padding: 10px 18px;
        font-size: 15px;
        border-radius: 6px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }


    h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }

}

.dropdown {
    background: white;
    border-radius: .3em;
    position: absolute;
    left: .1em;
    padding: .5em;
    width: 100%;
    box-sizing: border-box;
    transform: translateY(-1em);
    transition: transform .5s;
    visibility: hidden;
    z-index: 10; /* Ensure it stays above other content */
    font-size: 0.85rem;

    ul {
        list-style-type: none;
        margin: 0;
        padding: 0;

        li {
            padding: 0; /* Remove padding here so the button can fill the space */

            /* Style the button to look like a menu link */
            .modal-trigger {
                width: 100%;
                background: none;
                border: none;
                text-align: left;
                padding: .8em;
                font-size: inherit;
                font-family: inherit;
                cursor: pointer;
                display: block;
                color: black;

                &:hover {
                    background: #E9E9E9;
                }
            }
        }
    }
}

.dropdown-wrapper {
    display: inline-block; /* shrinks to button width */
}

.dropdown-wrapper:hover .dropdown {
    visibility: visible;
    transform: translateY(0);
}
/* Temp disable on hover effect when dropdown item is clicked */
.dropdown-wrapper.no-hover .dropdown {
    visibility: hidden;
    transform: translateY(-1em);
}

.container{
    position: relative;
    display: inline-block;
}
/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content/Box */
.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
}

/* The Close Button */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
.dropdown.active{
    visibility: visible;
    transform: translateY(0);
}