@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;700&display=swap');

/* Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/) */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */

article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}

body {
	line-height: 1;
    flex-grow: 1;
}

ol, ul {
	list-style: none;
}

blockquote, q {
	quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* Custom reset */

* {
    margin: 0px;
    padding: 0px;
    text-decoration: none;
    box-sizing: border-box;
}

@font-face {
    font-family: "Open Runde";
    src: url('fonts/OpenRunde-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Open Runde";
    src: url('fonts/OpenRunde-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

html {
    font-family: 'Inter', -apple-system, system-ui, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 62.5%;
    display: flex;
    min-height: 100vh;
}

.mono {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

body {
    font-size: 1.6rem;
    margin: 16px;
    display: flex;
    flex-direction: column;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spacer {
    flex-grow: 1;
}

button, .title {
    font-family: 'Inter', -apple-system, system-ui, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    border-radius: 6px;
    border: 1px solid #C9CAD6;
    background: white;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;

    &:hover {
        background-color: #F2F3FB;
    }

    &:active {
        background-color: #E3E5EF;
    }

    &>span {
        margin: 0 2px 0 8px;
    }
}

.accent {
    background-color: #F9F2E7;
    color: #916600;
    border: 1px solid #DDA846;

    &:hover {
        background-color: #F3E1C5;
    }

    &:active {
        background-color: #E8C68E;
    }
}

.title {
    font-weight: 600;
}

#game {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 16px;
}

#dialogs {
    justify-content: center;  
    height: 32px;  
}

#messageDialog {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    display: none;
}

#dialogContent {
    border-radius: 6px;
    border: 1px solid #E3E5EF;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 8px;
}

#dialogScore {
    color: #FA9774;
    font-size: 1.6rem;
    font-weight: 600;
}

#wordInput {
    font-size: 4.4rem;
    text-transform: uppercase;
    text-align: center;
    margin: 0 auto 32px;
    max-width: 90vh;
    overflow-x: auto;
    overflow-y: hidden;
    letter-spacing: 1rem;
    font-family: 'Open Runde';
    caret-color: #DDA846;
    min-width: 5px;
    white-space: nowrap;

    &:focus {
        outline: none;
    }
}



.invalid-letter {
    color: #C9CAD6;
}

.required-letter {
    color: #DDA846;
}

#letters {
    justify-content: center;
    font-weight: 800;
}

.letter {
    display: inline-block;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: white;
    border: 1px solid #C9CAD6;
    text-align: center;
    line-height: 48px;
    font-weight: 700;
    user-select: none;
    cursor: pointer;
    transition: transform 0.1s;
    padding: 0;
    font-family: 'Open Runde';

    &:hover {
        transform: scale(1.1);
        background-color: #F2F3FB;
    }

    &:active {
        transform: scale(0.9);
        background-color: #E3E5EF;
    }

}

.required {
    background-color: #F9F2E7;
    border: 1px solid #DDA846;

    &:hover {
        background-color: #F3E1C5;
    }

    &:active {
        transform: scale(0.9);
        background-color: #E8C68E;
    }
}

#controls {
    justify-content: center;

    &>button {
        display: flex;
        justify-content: center;
        user-select: none;
        width: 48px;
        height: 48px;
        border-radius: 12px;
        cursor: pointer;
        transition: transform 0.1s;

        &:hover {
            transform: scale(1.1);
        }

        &:active {
            transform: scale(0.9);
            background-color: #E3E5EF;
        }

        &>img {
            height: 24px;
            width: 24px;
        }
    }
}

#words {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 1.2rem;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: #FCFBF8;
    padding: 16px;
    display: flex;
    align-items: center;

    &>div {
        display: flex;
        align-items: center;

        &>img {
            margin-right: 4px;
        }
    }
}

.score {
    font-weight: 600;
}

#words>#foundWords {
    display: block;
    padding: 0 0 24px 0;
    line-height: 1.5;
}

#scoreBar-outer {
    width: 100%;
    height: 12px;
    background-color: #F9F2E7;
    border: 1px solid #DDA846;
    border-radius: 2px;
}

#scoreBar-inner {
    height: 8px;
    background-color: #E8C68E;
    border-radius: 1px 0 0 1px;
    margin: 1px;

    transition-property: width;
    transition-duration: .3s;
}

#dots {
    position: absolute;
    display: flex;
    left: 32px;
    right: 32px;
    margin: 0 4px;
    justify-content: space-between;

    &>div {
        background-color: #DDA846;
        height: 4px;
        max-width: 4px;
        border-radius: 2px;
        flex-grow: 1;

    }

    &>:first-child {
        background-color: rgba(0, 0, 0, 0);
    }
}

@media (max-width: 416px) {
    #letters {
        display: grid;
    }

    #letters>span:nth-child(1) {
        grid-column-start: 2;
        grid-column-end: 4;
        grid-row-start: 0;
        grid-row-end: 1;
        justify-self: center;
    }

    #letters>span:nth-child(2) {
        grid-column-start: 4;
        grid-column-end: 6;
        grid-row-start: 0;
        grid-row-end: 1;
    }

    #letters>span:nth-child(3) {
        grid-column-start: 1;
        grid-column-end: 3;
        grid-row-start: 1;
        grid-row-end: 2;
    }

    #letters>span:nth-child(4) {
        grid-column-start: 3;
        grid-column-end: 5;
        grid-row-start: 1;
        grid-row-end: 2;
    }

    #letters>span:nth-child(5) {
        grid-column-start: 5;
        grid-column-end: 7;
        grid-row-start: 1;
        grid-row-end: 2;
    }

    #letters>span:nth-child(6) {
        grid-column-start: 2;
        grid-column-end: 4;
        grid-row-start: 2;
        grid-row-end: 3;
    }

    #letters>span:nth-child(7) {
        grid-column-start: 4;
        grid-column-end: 6;
        grid-row-start: 2;
        grid-row-end: 3;
    }
}

a {
    height: 16px;
    color: black;
}

.horizontal {
    flex-direction: row;
}

#main {
    margin-top: 32px;
    gap: 16px;
    display: flex;
    flex-wrap: wrap;
}

.hero {
    aspect-ratio: 2.76 / 1;
    justify-content: center;
    min-width: 200px;
    flex-grow: 1;
    color: #9EA0AB;
    text-transform: uppercase;

    &>a {
        flex-grow: 1;
        height: 100%;
        display: flex;

        &>img {
            vertical-align: middle;
            margin: auto;
            max-width: 150px;
            max-height: 50px;
        }
    }
}

.helpText {
    display: none;
    position: fixed;
    border: 1px solid #C9CAD6;
    background-color: #FAFBFE;
    top: 58px;
    left: 0;
    margin: 0 16px;
    padding: 24px;
    border-radius: 6px;
    flex-direction: column;
    gap: 16px;
    line-height: 2rem;
    font-size: 1.4rem;
    
}

.help:hover+.helpText {
    display: flex;
}

.exampleLetters {
    display: flex;
    align-items: center;
    gap: 4px;

    &>div {
        width: 24px;
        height: 24px;
        text-align: center;
        background-color: white;
        border: 1px solid #C9CAD6;
        border-radius: 4px;
    }

    &>.required {
        background-color: #F9F2E7;
        border: 1px solid #DDA846;
    }
}
.exampleScore {
    color: #DDA846;
    margin-left: 4px;
}

#rank {
    color: #BA8400;
    margin-left: 8px;
}

 #date {
    margin: 0;
 }

 .dropdown {
    display: none;
    position: absolute;
    padding-top: 8px;

    ul {
        border: 1px solid #C9CAD6;
        border-radius: 6px;
    }

    &>ul>li>button {
        border: none;
        padding: 8px;
        width: 100%;
    }
 }

 ul>li {
    &:hover > .dropdown, .dropdown:hover {
        display: block;
    }
 }

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Make sure it doesn't interfere with clicks */
}

#typo {
    width: 16px;
}