@font-face {
    font-family: "dill2";
    src: url("dill2.ttf") format("woff");
}

* {
    font-family: "dill2", Arial, sans-serif !important;
}

body {
    margin: 0;
    padding: 15px;
    background: #FF0000;
    color: #222;
}


.game {
    max-width: 600px;
    margin: 20px auto;
    padding: 25px;
    background: white;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}


/* Title */

h1 {
    margin: 0 0 2px 0;
    font-size: 24px;
    letter-spacing: 4px;
}


/* Instructions */

.instructions {
    margin-top: 0;
    font-size: 17px;
    color: #666;
}


/* Current word */

#currentword {
    min-height: 55px;
    margin: 30px 0 20px;
    font-size: 38px;
    font-weight: bold;
    letter-spacing: 7px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 12px;
}


/* Rank */

#rank {
    margin-top: 20px;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 2px;
}


#progress {
    margin-top: 6px;
    font-size: 15px;
    color: #666;
}


/* Special rank: Linguist */

#rank.linguist {
    font-size: 34px;
    letter-spacing: 4px;
    color: #D4AF37;
}


/* Special rank: Wordmaster */

#rank.wordmaster {
    font-size: 40px;
    letter-spacing: 5px;
    font-weight: bold;
    color: #D4AF37;
}


/* Letters */

#letters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    max-width: 500px;
    margin: 25px auto 0;
}


.letter {
    width: 58px;
    height: 58px;

    font-size: 25px;
    font-weight: bold;

    border: none;
    border-radius: 10px;

    background: #800080;
    color: yellow;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;
}



@media (hover: hover) and (pointer: fine) {
    .letter:hover {
        background: #555;
    }
}


.letter:active {
    transform: scale(0.94);
}


/* LINGUIST celebration */

.letter.celebrate {
    animation: linguistBounce 3s ease;
}


@keyframes linguistBounce {

    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.18);
    }

    70% {
        transform: scale(0.94);
    }

    100% {
        transform: scale(1);
    }

}


/* Used letters */

.letter.used,
.letter.used:hover {
    background: #aaa !important;
    color: #eee !important;
    cursor: default;
}


/* Controls */

.controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}


.controls button {
    padding: 12px 15px;

    font-size: 14px;
    font-weight: bold;

    border: none;
    border-radius: 7px;

    background: #ddd;
    color: #222;

    cursor: pointer;
}


#enter {
    background: #176b2c;
    color: yellow;
    padding: 12px 22px;
}
#backspace {
    background: #FFC0CB;
}

#shuffle {
    background: #FFC0CB;
}


.controls button:active {
    transform: scale(0.96);
}


/* Message */

#message {
    min-height: 30px;
    margin-top: 18px;
    font-weight: bold;
}


/* Score */

.score {
    margin-top: 10px;
    font-size: 20px;
}


/* Hint, Hall of Fame & Brag buttons */

#hint, #hallButton, #bragButton {
    display: inline-block;
    width: auto;
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 7px;
    cursor: pointer;
    border: 2px solid #ccc;
    background: #f0f0f0;
    color: #222;
}

#hint {
    font-size: 24px;
    padding: 6px 16px;
    background: #FFC0CB;
    border-radius: 7px;
}

#hint:active, #hallButton:active, #bragButton:active, #sortToggleBtn:active {
    transform: scale(0.96);
}

#bragButton {
    border-color: #333;
    background: #FFD700;
}

#hallButton {
    background: #e8e8e8;
}

/* Alfabetisk-knapp */

#sortToggleBtn {
    display: inline-block;
    margin-left: 8px;
    padding: 6px 12px;
    font-size: 0.65em;
    font-weight: bold;
    border: 2px solid #ccc;
    border-radius: 7px;
    background: #FFC0CB;
    color: #222;
    cursor: pointer;
}


#hintbox {
    display: none;
    margin: 10px auto 15px auto;
    padding: 12px;
    max-width: 320px;
    text-align: left;
}


#hintbox.show {
    display: block;
}


.hint-title {
    font-weight: bold;
    margin-bottom: 10px;
}


.hint-group {
    margin: 6px 0;
}


.hint-letter {
    display: inline-block;
    width: 25px;
    font-weight: bold;
}


.hint-details {
    font-size: 14px;
}


/* Found words */

.found {
    margin-top: 30px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}


.found h2 {
    font-size: 20px;
}


#foundwords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}


.foundword {
    display: inline-block;
    padding: 7px 10px;

    background: #e8e8e8;
    border-radius: 5px;

    font-size: 15px;
}


/* Small screens */

@media (max-width: 500px) {

    body {
        padding: 8px;
    }


    .game {
        margin: 5px auto;
        padding: 18px 12px;
    }


    h1 {
        font-size: 22px;
        letter-spacing: 3px;
    }


    .instructions {
        font-size: 15px;
    }


    #currentword {
        margin-top: 20px;
        font-size: 32px;
        letter-spacing: 5px;
    }


    #rank {
        font-size: 20px;
    }


    #rank.linguist {
    font-size: 34px;
    letter-spacing: 4px;
    font-weight: bold;
    color: #D4AF37;
    }


    #rank.wordmaster {
    font-size: 40px;
    letter-spacing: 5px;
    font-weight: bold;
    color: #D4AF37;
    }


    #letters {
        gap: 7px;
    }


    .letter {
        width: 52px;
        height: 52px;
        font-size: 23px;
    }


    .controls button {
        padding: 14px 16px;
    }

}
