@import url('https://fonts.googleapis.com/css2?family=Indie+Flower&display=swap');

:root {
    --bgc : #333;
    --textPrimary : #fff;
    --textSecondary : #666;
    --primaryColor : #fd4;
}

body {
    font-family: 'Indie Flower', cursive;
    font-family: monospace;
    font-size: 1.5em;
    background-color: var(--bgc);
    color: var(--textPrimary);
}

main {
    width: 600px;
    margin: 50px auto;
}

h1 {
    color: var(--primaryColor);
}

#header{
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 20px 6px 30px;
    justify-content: space-between;
}

#buttons {
    text-align: right;
    display: flex;
}

#info {
    color : var(--primaryColor);
}

button {
    background-color: rgba(255,255,255, 0.2);
    border: none;
    color: rgba(255,255,255, 0.5);
    padding: 5px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 20px;
}

.word {
    position: relative;
    display: flex;
    margin: 0 6px;
    color: var(--textSecondary);
}

#words {
    display: flex;
    flex-wrap: wrap;
    row-gap: 16px; 
}

#game {
    line-height: 20px;
    height: 105px;
    overflow: hidden;
    position: relative;
    outline: 0;
}

#game:not(:focus) #words {
    filter: blur(5px);
}

#game:focus #words {
    filter: blur(0px);
} 

#game:focus #focus-error {
    display: none;
} 

#game:not(:focus) #focus-error {
    display: block;
}  

#game:not(:focus) .letter.current::after {
    display: none;
} 

#focus-error {
    position: absolute;
    inset: 0;
    display: none;
    text-align: center;
    padding-top: 35px;
    color: var(--textPrimary);
} 

.letter.correct {
    color:#fff
}

.letter.incorrect {
    color:#f93737
}

.letter {
    position: relative;
}

.letter.current::after {
    display: block;
    content: "";
    height: 100%;
    width: 2px;
    background-color: var(--primaryColor);
    position: absolute;
    left: -1px;
    bottom: 0;
    opacity: 10%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%{opacity: 0%;}
    50%{opacity: 100%;}
    100%{opacity: 0%;}
}

#game.over .letter.current::after {
    display: none;
}

#game.over #words{
    opacity: 0.4;
    filter: blur(0px);
}

#game.over #focus-error {
    display: none;
}

.clicked {
    color: var(--primaryColor);
}

.custom {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: var(--bgc);
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(164, 139, 139, 0.2);
}

.custom h2 {
text-align: center;
margin-top: auto;
}

.custom input {
display: block;
padding: 10px;
width: 280px;
border: none;
margin-bottom: 20px;
border-radius: 5px;
}

.custom button {
margin: 0 auto;
display: block;
padding: 10px 20px;
width: 300px;
text-align: center;
align-items: center;
background-color: var(--primaryColor);
color: var(--textSecondary);
border: none;
border-radius: 5px;
}

.custom {
    display: none;

}
.customDisplay{
    display: block;
}

.makeBlur {
    filter: blur(6px);
    opacity: 0.5;
}

#custom_icon {
    font-size: 1rem;
}

#results {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

#results .stat {
    font-size: 2em;
    color: var(--primaryColor);
    margin: 10px 0;
}

#details {
    margin-top: 20px;
    text-align: center;
    color: var(--primaryColor);
    font-size: 1.2em;
}

#restartBtn {
    background-color: rgba(255,255,255, 0.2);
    border: none;
    color: rgba(255,255,255, 0.5);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}