/* -----------------------------
   GLOBAL
----------------------------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: Arial, Helvetica, sans-serif;

    background:
        radial-gradient(
            circle at top,
            #24334d 0%,
            #101827 45%,
            #090d15 100%
        );

    color: white;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    padding: 40px 15px;
}

.game {
    width: 100%;
    max-width: 620px;
}


/* -----------------------------
   HEADER
----------------------------- */

header {
    text-align: center;
    margin-bottom: 25px;
}

.logo {
    font-size: clamp(2.3rem, 8vw, 4rem);
    margin: 0;

    font-weight: 900;
    letter-spacing: -2px;
}

.logo span {
    color: #78e08f;
}

.subtitle {
    color: #aab4c3;
    margin-top: 8px;
}


/* -----------------------------
   GAME PANEL
----------------------------- */

.panel {
    background: rgba(255, 255, 255, 0.07);

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 24px;

    padding: 25px;

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.35);
}


/* -----------------------------
   CURRENT WORD
----------------------------- */

.goal-label {
    text-align: center;

    color: #8490a3;

    font-size: 0.8rem;
    letter-spacing: 2px;
}

.goal {
    text-align: center;

    font-size: 1.6rem;
    font-weight: bold;

    margin: 6px 0 25px;
}


/* -----------------------------
   LETTER TILES
----------------------------- */

.tiles {
    display: flex;
    justify-content: center;

    gap: 10px;

    margin-bottom: 25px;
}

.tile {
    width: 75px;
    height: 85px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #182337;

    border:
        2px solid
        #33425b;

    border-radius: 15px;

    font-size: 2.7rem;
    font-weight: 900;

    text-transform: uppercase;

    transition:
        transform 0.2s,
        background 0.2s,
        border 0.2s;
}

.tile.changed {
    background: #244e38;
    border-color: #78e08f;

    transform: scale(1.08);
}


/* -----------------------------
   STATS
----------------------------- */

.stats {
    display: flex;
    justify-content: center;

    gap: 55px;

    padding: 15px 0 25px;
}

.stat {
    text-align: center;
}

.stat-label {
    font-size: 0.7rem;
    letter-spacing: 2px;

    color: #8490a3;
}

.stat-value {
    display: block;

    font-size: 1.5rem;
    font-weight: bold;

    margin-top: 5px;
}


/* -----------------------------
   INPUT
----------------------------- */

.input-area {
    display: flex;
    gap: 10px;
}

input {
    flex: 1;

    min-width: 0;

    padding: 16px;

    background: #101827;
    color: white;

    border:
        2px solid
        #33425b;

    border-radius: 12px;

    outline: none;

    text-transform: uppercase;
    text-align: center;

    font-size: 1.5rem;
    font-weight: bold;

    letter-spacing: 6px;
}

input:focus {
    border-color: #78e08f;
}


/* -----------------------------
   BUTTONS
----------------------------- */

button {
    border: 0;
    border-radius: 12px;

    padding: 0 22px;

    font-weight: 800;

    cursor: pointer;

    transition:
        transform 0.15s,
        opacity 0.15s;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.submit {
    background: #78e08f;
    color: #101827;
}


/* -----------------------------
   MESSAGE
----------------------------- */

.message {
    height: 28px;

    margin-top: 15px;

    text-align: center;
    font-weight: bold;

    color: #aab4c3;
}

.message.error {
    color: #ff7675;
}

.message.good {
    color: #78e08f;
}


/* -----------------------------
   HISTORY
----------------------------- */

.history-section {
    margin-top: 25px;
}

.history-title {
    color: #8490a3;

    font-size: 0.75rem;
    letter-spacing: 2px;

    margin-bottom: 10px;
}

.history {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.history-word {
    background: #182337;

    border:
        1px solid
        #33425b;

    border-radius: 8px;

    padding: 8px 11px;

    font-weight: bold;
    letter-spacing: 2px;
}


/* -----------------------------
   ACTION BUTTONS
----------------------------- */

.actions {
    display: flex;

    gap: 10px;

    margin-top: 25px;
}

.secondary {
    flex: 1;

    background: #27354b;
    color: white;

    padding: 14px;
}


/* -----------------------------
   WIN SCREEN
----------------------------- */

.win-screen {
    display: none;

    text-align: center;

    padding: 25px 0 10px;
}

.win-screen.show {
    display: block;
}

.win-emoji {
    font-size: 5rem;

    animation:
        fartPop 0.6s ease;
}

.win-title {
    font-size: 2.5rem;

    margin: 5px 0;

    color: #78e08f;
}

.win-info {
    color: #aab4c3;

    margin-bottom: 20px;
}

.play-again {
    padding: 15px 30px;

    background: #78e08f;
    color: #101827;

    font-size: 1rem;
}


/* -----------------------------
   ERROR SHAKE
----------------------------- */

.shake {
    animation:
        shake 0.3s;
}

@keyframes shake {

    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    50% {
        transform: translateX(8px);
    }

    75% {
        transform: translateX(-8px);
    }

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


/* -----------------------------
   WIN ANIMATION
----------------------------- */

@keyframes fartPop {

    0% {
        transform:
            scale(0.3)
            rotate(-20deg);
    }

    70% {
        transform:
            scale(1.3)
            rotate(10deg);
    }

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


/* -----------------------------
   MOBILE
----------------------------- */

@media (max-width: 500px) {

    .panel {
        padding: 18px;
    }

    .tile {
        width: 60px;
        height: 70px;

        font-size: 2.1rem;
    }

    .input-area {
        flex-direction: column;
    }

    .submit {
        padding: 15px;
    }
}
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    text-align: center;
    padding: 15px 0;

    color: #8490a3;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 1px;
}