/*---- general ----- */

body {
    font-family: "Courier Prime", sans-serif;
    background-color: #eeeed7;
    margin: 30px 0 0 0;
    padding: 0;
    text-align: center;
    justify-content: center;
    /* height: 100%; */
}

header {

    background-color: #fff;
    padding: 4px 1em 2px 1em;
    border-bottom: #aaa solid 2px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;

}

#home-logo img {
    border-radius: 5px;
    height: 32px;
    box-shadow: 2px 2px 2px #444;
}

nav {
    display: inline-flex;
    width: 100%;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    gap: 5rem;
    z-index: 1000;
}
.touch-device nav{
    width: 80vw;
}

#nav-links {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    width: 60vw;
}

#nav-links div {
    display: inline-flex;
    justify-content: space-between;
    gap: .5em;
}

#login-area {
    position: relative;
    right: 0;
}

.bottom-border-black {
    border-bottom: .1em solid #000;
}

.touch-device #nav-links {
    display: none;
}

.touch-device nav {
    gap: 2rem;
}

.touch-device header {
    max-width: 100vw;
    width: 100%;
}

#nav-option-button {
    display: none;
}

.touch-device #nav-option-button {
    display: inherit;

    height: 2em;
    width: 2em;
    background-image: url('/Assets/images/downward-chevron.png');
    background-color: transparent;
    background-size: 1.5em 1.5em;
    background-position: center;
    background-repeat: no-repeat;
    transition: all .25s ease;
    border: 0;
}

#nav-option-button.open {
    border-bottom: #000;
    border-width: .1em;
}

#nav-option-button.closed {
    transform: rotate(90deg);
}

#option-dropdown {
    position: fixed;
    display: flex;
    flex-direction: column;
    text-align: right;
    padding: .2em;
    font-size: 1.4em;
    background-color: #fff;
    z-index: 0;
    left: 55vw;
    transition: top .25s ease-in-out;
}

#option-dropdown.closed {
    top: -150px;
}

#option-dropdown.open {
    top: 2em;
}

#option-dropdown a {
    text-decoration: none;
    margin-top: .3em;
    border-bottom: .1em solid #000;
}

.greeting {
    font-size: .85em;
}

.touch-device .greeting {
    font-size: .5em;
}

.flex-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    /* gap: 1em; */
    align-items: baseline;
}

#login-popup {
    position: fixed;
    top: -300px;
    width: 20em;
    justify-self: center;
    transition: top 0.5s ease;
    border: 2px solid #000;
    background-color: #9df;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, .5);
}

#login-popup.show {
    top: 60px;
}

#login-popup.hide {
    top: -300px
}

#login-popup p {
    margin: .5em 0;
}

.touch-device #login-popup {
    min-height: 0;
    height: 13em;
}

#login-form {
    display: flex;
    flex-direction: column;
}

#login-form input {
    margin: .5em auto;
    width: 10em;
}

#login-form button {
    width: 5em;
    margin: .5em auto;
}

#login-submit-btn {
    background-color: #2af;
    border: 1px solid #1932d1;
}

#login-submit-btn:hover {
    background-color: #18c;
}

#login-btn-m,
#logout-btn-m {
    border-bottom: .1em solid #000;
}

#login-btn,
#login-btn-m,
#logout-btn,
#logout-btn-m,
#signup-btn,
#existing-acnt-btn {
    margin: auto auto;
    background-color: transparent;
    border: 1px solid #ccc;
    padding: .35em;
    border-radius: 2em;
}

#login-btn:hover,
#logout-btn:hover,
#signup-btn:hover,
#existing-acnt-btn:hover {
    text-decoration: underline;
    color: #1932d1;
    background-color: #edfaff;
}

#existing-acnt-btn {
    position: absolute;
    left: 1em;
    top: 1em;
}

#signup-input.hide,
#signup-btn.hide,
#existing-acnt-btn.hide {
    margin: 0;
    height: 0px;
    visibility: hidden;
}

#signup-btn.show,
#signup-input.show,
#existing-acnt-btn.show {
    visibility: visible;
}

#stats-btn,
#stats-btn-m {
    padding: .13em .3em;
    border-radius: 1em;
    border-width: .1em;
}

#stats-btn img,
#stats-btn-m img {
    height: 16px;
}

#stats-popup {
    position: fixed;
    text-align: left;
    top: -1000px;
    width: 25em;
    justify-self: center;
    transition: top 0.5s ease;
    border: 2px solid #359;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, .5);
    padding: 1em 1em;
    background: linear-gradient(0.492turn, #cef, transparent 93%, #46d),
        linear-gradient(0.375turn, #def, #9df 70%, #69e);
    color: #333;
}

.touch-device #stats-popup {
    min-height: 0;
    height: auto;
    width: 80vw;
}

#stats-popup.show {
    top: .5em;
}

#stats-popup.hide {
    top: -1000px;
}

.touch-device #stats-popup.hide {
    top: -160vw;
}

#result-area {
    text-align: center;
    margin: 0 1em;
    border-bottom: 1px solid #69d;
}

#result-area.show {
    visibility: visible;
}

#result-area.hide {
    visibility: hidden;
    height: 0;
}

#result-mistake-area {
    background-color: #e1eff1;
    margin: .5em auto;
    border-radius: 2em;
    width: 18em;
    border: #000 solid 1px;
    padding: .2em 0 0;
}

#num-mistakes-text {
    font-size: .75em;
    margin: 0;
}

#result-message-text {
    font-size: 1em;
    margin: 0;
}

#stats-text {
    margin: 1em;
}

.win-info {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    padding: 1em 0;
    gap: 2em 0;
    border-top: 1px solid #69d;
    margin: 0 1em;
    /* background: linear-gradient(0.5turn, #3f87a6, transparent); */
}

.stat {
    display: block;
    width: 33%;
    text-align: center;
}

.num {
    margin: 0;
    color: #224;
}

.go-up {
    color: #583;
}

.go-down {
    color: #943;
}

.stat p {
    margin: 0;
}

.dist-graph {
    border-top: 1px solid #69d;
    width: 110%;
    padding: 0;
    margin: 0;
}

h3 {
    margin: 1em 0 0 0;
}

.container {
    background-color: #ddd;
    padding: 1.5em 20px;
    margin: 5px auto;
    margin-top: 50px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 85vw;
    max-width: 550px;
    text-align: center;
    font-family: "Courier Prime", sans-serif;
}

.touch-device .container {
    min-height: 78vh;
}

.touch-device #about {
    height: 72vh;
}

h1 {
    margin-top: 20px;
    padding-top: 5px;
    margin-bottom: 0;
}

h2 {
    font-size: 1.5em;
    padding: 0;
    margin: 0;
}

footer {
    text-align: center;
    margin: .5em 0;

    color: #666;
}

#attempt-counter {
    display: inline-flex;
    align-items: center;
    position: absolute;
    z-index: 0;
    top: 3em;
    left: 50%;
    transform: translate(9em);
}

#attempt-counter p {
    margin: .5em 0;
}

#attempts-box {
    display: flex;
}

.dot {
    background-color: #888;
    border-radius: 5px;
    margin: 0 .1em;
    padding: 5px;
}


/* ---- mobile / touch screen ---- */

body.touch-device {
    overflow: hidden;
    max-width: 100vw;
    touch-action: none;
}

.touch-device #attempt-counter {
    position: initial;
    transform: none;
}

.touch-device #word-bank {
    margin: 0;
}

/* puzzle slots */
#slots {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#slots .slot {
    display: flex;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border: 2px dashed transparent;
    margin: 5px 0;
    text-align: center;
    background-color: transparent;
}

#slots button:hover {
    cursor: move;
}

#slots .drag-hover {
    border-color: rgb(255, 174, 0);
}

#slots .slotted {
    border-width: 0px;
    margin: 7px 0;
}

.slot-letter-box {
    width: 32px;
    height: 32px;
    line-height: 32;
    border: 2px dashed #888;
    margin: 0 auto;
    margin-top: -2px;
    pointer-events: none;
    text-align: center;
    font-size: 1em;
}

.slot-letter-box .correct {
    background-color: #393;
    border-color: #7d7;
    color: #ddd;
    pointer-events: none;
}

.hint {
    margin: 0 auto;
    line-height: 34px;
    font-family: 'Courier Prime', sans-serif;
    font-size: 1em;
    font-weight: 500;
    text-transform: uppercase;
    margin-top: -2px;
    margin-left: -2px;
}

.hint.hide {
    background-color: transparent;
    border-color: transparent;
    color: transparent;
    font-size: 0em;
}

.hint.show {
    width: 32px;
    height: 32px;
    background-color: #2a1;
    border: 2px dashed #7d7;
    color: #bbb;
}

/* ------- draggable -------- */
.drag-image {
    position: absolute;
    display: inline-flex;
    border-color: #9ad;
    color: #333;
    padding: 5px;
    gap: 5px;
    background-color: transparent;
    cursor: pointer;
    pointer-events: none;
    font-size: 0;
    font-family: "Courier Prime", sans-serif;
    border-width: 0;
    text-shadow: -1px 0px 0px rgb(148, 148, 148);
    z-index: 1;
}

.drag-image.false {
    color: #833;
    border-color: #a44;
}

.drag-image.false:hover {
    border-color: #d44;
}

.drag-image.almost {
    border-color: #cc2;
}

.drag-image.almost:hover {
    border-color: #fe2;
}

.drag-image.correct {
    border-color: #3d3;

}

.drag-image.correct:hover {
    border-color: #4f5;

}

.draggable-letter-box {
    width: 32px;
    height: 32px;
    line-height: 34px;
    border-color: inherit;
    border-width: 2px;
    border-style: dashed;
    text-align: center;
    font-size: large;
    color: inherit;
    background-color: rgb(243, 245, 222);
    text-transform: uppercase;
    box-shadow: 3px 3px 2px rgba(10, 10, 10, .5);

}

.false .draggable-letter-box {
    background-color: rgb(243, 217, 210);
}

.almost .draggable-letter-box {
    background-color: rgb(240, 243, 210);
}

.draggable-letter-box.correct {
    background-color: #2c8b2c;
    border-color: #3bca3b;
    border-radius: 2px;
}

.draggable-letter-box.correct.highlight {
    background: linear-gradient(90deg, #2fe02f, transparent, #2fe02f),
        linear-gradient(#2fe02f, transparent, #2fe02f);
    background-color: #269e26;
    border-color: #00ff00;
}

.draggable-letter-box.almost {
    background-color: #c2c21a;
    border-color: #ffff4a;
}

.draggable-letter-box.almost.highlight {
    background: linear-gradient(90deg, #e9e25d, transparent, #e9e25d),
        linear-gradient(#e9e25d, transparent, #e9e25d);
    background-color: #c2c21a;
    border-color: #ffff00;
}

.dropped {
    border-color: #9ad;
    pointer-events: all;
    z-index: 0;
}

.dropped .draggable-letter-box {
    box-shadow: none;
}

.dropped:hover {
    border-color: #2af;
    background-color: transparent;
    color: #333;
}

.dropped .highlight {
    background: linear-gradient(90deg, #eee, transparent, #eee),
        linear-gradient(#eee, transparent, #eee);
    color: #000;
}

.dropped .hide {
    border-color: transparent;
    color: transparent;
}

.dropped .hide:hover {
    background-color: transparent;
    border-color: transparent;
}

/* --------word bank----------- */

#word-bank {
    margin: 1.5em 0;
}

.draggable-word {
    display: inline-block;
    margin: .1em;
    padding: .6em .5em;
    font-size: .9em;
    background-color: #8a8a8a;
    color: #fff;
    border-radius: 4px;
    cursor: move;
}

.draggable-word.used {
    background-color: #ccc;
    cursor: default;
}

.draggable-word.correct {
    background-color: #4CAF50;
}

.draggable-word.almost {
    background-color: #cee40e;
}

.draggable-word.correct.used {
    background-color: #537e54;
}

.draggable-word.almost.used {
    background-color: #9da558;
}

.draggable-word.false {
    background-color: #f44336;
}

.draggable-word.false.used {
    background-color: #6e5250;
}

.draggable-word:hover {
    box-shadow: 0px 0px 4px rgba(0, 0, 0, .5);
}

/* utility buttons and game message */

.utility-button {
    margin-bottom: .4em;
    margin-left: .4em;
    font-family: 'Courier Prime', sans-serif;
    font-size: .9em;
    font-weight: 300;
    border-radius: 4px;
    padding: 10px 20px;
    color: #ddd;
    background-color: #666;
    cursor: pointer;
    border: none;
}

.utility-button:hover {
    background-color: #444;
    box-shadow: 0px 0px 2px #000;
    color: #fff;
}

.utility-button:active {
    transform: scale(1.05);
    background-color: #333;
}

.utility-button:disabled {
    pointer-events: none;
    background-color: #ccc;
}

.utility-button.hide {
    padding: 0;
    margin: 0;
    width: 0;
}

#layout-button {
    font-size: 12px;
    padding-bottom: 0;
    padding-block: 0;
}

/* puzzle nav */

#puzzle-nav {
    display: inline-flex;
    margin-top: .5em;
    align-items: center;
    font-size: 1.2em;
    gap: 10px;
}

.puzzle-nav-btn {
    background-color: transparent;
    border: none;
    font-size: 1.3em;
    font-weight: 800;
    font-family: "Courier Prime";
    cursor: pointer;
    padding: 0 .3em;
    border-radius: .3em;
}

.puzzle-nav-btn:hover {
    background-color: rgba(180, 180, 180, .3);
}

.puzzle-nav-btn:active {
    background-color: rgba(90, 90, 90, .2);
}

.puzzle-nav-btn:disabled {
    color: #888;
    pointer-events: none;
}

#puzzle-nav p,
#puzzle-nav span {
    margin: 0;
    font-size: .8em;
    text-wrap: nowrap;
}

/* messages */

#gameMessage {
    position: fixed;
    top: -50px;
    /* Start above the screen */
    left: 50vw;
    transform: translateX(-50%);
    /* Keep centered horizontally */
    background-color: #000 !important;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    z-index: 1000;
    opacity: 0;
    transition: top 0.5s ease, opacity 0.5s ease;
    /* Opening transition (top and opacity) */
    font-size: 15px;
}

#gameMessage.show {
    top: 60px;
    /* The final position, sliding down */
    opacity: 1;
    /* Fully visible */
}

#gameMessage.hide {
    opacity: 0;
    /* Fade out */
    transform: translateX(-50%) scale(0.8);
    /* Scale down to 80% when hiding */
    transition: opacity 0.3s ease;
    /* Closing transition (scaling and opacity) */
}

#definition-popup {
    position: fixed;
    height: 17rem;
    width: 23rem;
    background-color: transparent;
    transition: top 0.5 ease;
    border: .15em solid #000;
    border-radius: .4em;
    box-shadow: .15em .15em .45em rgba(20, 20, 20, 0.3);
    top: -500px;
}

.touch-device #definition-popup {
    width: 80vw;
}

#popup-content {
    border-radius: .2em;
    margin-top: 1.5rem;
    height: 12.5rem;
    overflow: auto;
}

#definition-popup:after,
#definition-popup:before {
    bottom: 100%;
    left: 50%;
    border: solid transparent;
    content: "";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

#definition-popup:after {
    border-bottom-color: #def;
    border-width: 33px;
    margin-left: -33px;
}

#definition-popup.hide:after {
    border-bottom-color: #eeeed7;
    /* copy color from body background*/
}

#definition-popup:before {
    border-bottom-color: #000;
    border-width: 36px;
    margin-left: -36px;
}

#definition-popup.show {
    z-index: 0;
    top: 5rem;
    background-color: #def;
    left: 2rem;

}

#definition-popup.hide {
    z-index: -1;
    /* top: -20rem; */
    background-color: transparent;
}

#definition-popup p {
    text-indent: -1em;
    margin: 0 1em 1em 2em;
    text-align: left;
}

.close-btn {
    position: absolute;
    line-height: 1.5em;
    background-color: transparent;
    top: 1%;
    left: 94%;
    border: 0;
    padding: .1em .5em;
    border-radius: .2em;
    font-weight: 800;
}

.close-btn:hover {
    color: #811;
    /* font-weight: 800; */
    /* border: 1px solid #ccc; */
    font-size: .8em;
}

.close-btn:active {
    font-size: .75em;
}

#popup-letter {
    position: absolute;
    padding: 3px;
    border-radius: .2em;
    background-color: #99afee;
    align-content: center;

}

#popup-letter:before {
    top: 100%;
    left: 50%;
    border: solid transparent;
    content: "";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
    border-top-color: #99afee;
    border-width: 10px;
    margin-left: -10px;
}

#pl-content {
    margin: auto;
    align-content: center;
    height: 1.6em;
    width: 1.6em;
    border: 2px dashed #1932d1;
    font-family: "Courier Prime", sans-serif;
    font-size: 1.5em;
    text-transform: uppercase;
}

ul {
    padding: 0;
    font-size: 1.5em;
    font-weight: bold;
}

#inst-cont li {
    border-left: 3px solid #2af;
    list-style: none;
    line-height: 20px;
    font-size: 16px;
    margin: 10px auto;
    padding-left: 5px;
    word-wrap: normal;
    width: 100%;
}

.touch-device #inst-cont li {
    font-size: .5em;
}

li span {
    font-style: italic;
    font-size: 1.2em;
    color: #399;
}

.ui {
    color: #c93;
}

li strong {
    color: #14a
}

.tw {
    color: #399;
}

.sl {
    color: #67e
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* -----search bar--------- */

.form-control {
    display: block;
    padding: .1rem .2rem;
    font-weight: 400;
    color: #42515c;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    appearance: none;
    border-right: 0;
    width: 10.5rem;
}

.search-container {
    display: flex !important;
    background: #ced4da;
    border-radius: 6px;
}

#search-container .close-button {
    display: none;
    opacity: .25;
}

#search-container .close-button:hover {
    opacity: .5;
}

.search {
    font-weight: bold;
    font-family: "Courier Prime", Helvetica, Arial, sans-serif;
    border-width: 2px;
    transition: all .25s;
    border-radius: 4px !important;
    font-weight: normal;
    font-family: "Courier Prime", Helvetica, Arial, sans-serif;
    font-size: 14px;
    /* color: #0a1b27; */
    background: #f4f4f4 !important;
}

.search::placeholder {
    color: #bbbbbb;
}

.close-button,
.search-button {
    /* height: 40px; */
    right: 0;
    top: 0;
    border-width: 2px;
    border-color: #ced4da;
}

.search-button {
    padding: .2rem .4rem;
}

.search-button.search-dictionary {
    background: #c5c5c5;
    border-radius: 0 6px 6px 0;
    border-left: 0;
    /* border-bottom: 2px solid #000000; */
    font-size: 0;
}

.search-button.search-dictionary svg g {
    fill: #f1f1f1;
}