@font-face {
    font-family: "Comic Sans";
    src: local("Comic Sans"),
        url("font/Comic%20Sans%20MS.ttf") format("truetype");
    font-display: swap;
}

body {
    font-family: "Comic Sans MS", "Comic Sans", sans-serif;
    font-size: large;
    width: 60%;
    margin: auto;
    padding-bottom: 30vh;
    background-color: #121212;
    color: #e0e0e0;
}

#credit {
    font-size: .3em;
}

a {
    color: #f62164;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


@media screen and (width <=800px) {
    body {
        width: 90%;
    }
}

p {
    line-break: anywhere;
}

#wordles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}


@media screen and (width <=800px) {
    #wordles {
        gap: 5px;
        justify-content: space-around;
    }
}


.wordle {
    padding: 6px;
    border: 1px solid #636363;
    background-color: #1e1e1e;
}

.wordle.solved {
    animation: wordleSolved 1s ease-out;
}

@keyframes wordleSolved {
    0% {
        transform: scale(1);
        transform: translateY(0px);
        opacity: 1;
    }

    40% {
        transform: scale(0.9);
        transform: translateY(-15px);
        opacity: 0;
    }

    40.001% {
        transform: scale(0.9);
        transform: translateY(5px);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        transform: translateY(0px);
        opacity: 1;
    }
}

.wordle-row {
    display: flex;
    justify-content: space-around;
}

.wordle-char {
    color: #ffffff;
    width: 30px;
    height: 30px;
    margin: 2px;
    text-align: center;
    font-weight: bold;
    line-height: 30px;
    border: 1px #313131 solid;
}

.char-g {
    background-color: #2d7c31;
}

.char-y {
    background-color: #ffc531;
    color: #000000;
}

.char-b {
    background-color: #2c2c2c;
}

.current .char-b {
    background: none;
    border: 1px #666666 solid;
}

.empty .char-b {
    background: none;
    border: 1px #313131 solid;
}

.wordle-char.pop {
    animation: charPop .3s ease-out;
}

@keyframes charPop {
    0% {
        transform: scale(1);
    }

    20% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.wordle-char.invalid {
    animation: invalidGuess .4s ease-out;
}

@keyframes invalidGuess {
    0% {
        color: #ff0000;
    }

    100% {
        color: #ffffff;
    }
}

.wordle-expand {
    width: 100%;
    border-radius: 0px;
    background: none;
    color: white;

    border: 2px #666666 solid;
    transition: background-color 150ms;
}

.wordle-expand:hover {
    background-color: #666666;
}

@media screen and (width <=800px) {
    .wordle-char {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 12px;
        margin: 1px;
    }

    .wordle {
        padding: 4px;
    }

    .wordle-expand {
        font-size: 14px;
        padding: 6px;
    }
}

.progress-numbers {
    height: 0;
}

.progress-number {
    color: #80ff00;
    position: absolute;
    text-align: center;
    width: 100%;
    animation: fadetext 1.6s linear;
}

@keyframes fadetext {
    0% {
        transform: translateY(-15px);
        opacity: 1;
    }

    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

#keyboard {
    position: fixed;
    bottom: env(safe-area-inset-bottom, 0);
    left: 50%;
    transform: translateX(-50%);

    width: 100vw;
    max-width: 100%;
    max-height: 30vh;
    overflow-y: auto;

    padding: 1vh;
    padding-bottom: env(safe-area-inset-bottom, 1vh);
    border-top: 1px solid #636363;
    background-color: #1e1e1e9c;

    box-sizing: border-box;
    z-index: 1000;
}

#keyboard p {
    text-align: center;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.key {
    margin: 0.3vh;
    padding: 1vh 1.5vh;
    min-width: 5vw;
    text-align: center;

    border-radius: 4px;
    background-color: #2c2c2c;
    color: #ffffff;
    user-select: none;

    font-weight: bold;
    font-size: 1.2em;
    transition: all 100ms;
    box-sizing: border-box;
}

.key:hover {
    background-color: #444444;
}

.wide {
    min-width: 10vw;
}

@media screen and (max-width: 800px) {
    #keyboard {
        max-height: 25vh;
        padding: 1vh;
    }

    .key {
        min-width: 6vw;
        padding: 1vh;
        font-size: 1em;
    }

    .key.wide {
        min-width: 12vw;
    }
}

@keyframes keypress {
    0% {
        transform: translateY(0px);
        background-color: #444444;
    }

    50% {
        transform: translateY(5px);
        background-color: #666666;
    }

    100% {
        transform: translateY(0px);
        background-color: #444444;
    }
}

.key.pressed {
    animation: keypress 150ms ease-in-out;
}

#victory-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    padding: 2.5rem;
    background: linear-gradient(135deg, #ffd700, #ffb700);
    border-radius: 20px;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
    animation: popIn 0.5s ease-out;
    border: 3px solid #313131;
}

#scroll-part {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

#scroll-text {
    display: inline-block;
    font-size: 5em;
    font-weight: 700;
    color: #1e1e1e;
    white-space: nowrap;
    padding-left: 100%;
    animation: scrollText 30s linear infinite;
}

@keyframes scrollText {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-100%);
    }
}


@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}
