body {
    font-family: 'Nunito', sans-serif;
    color: black;
    text-align: center;
    flex-direction: column;
    justify-content: flex-start;
    height: 100vh;
    margin: 0;
    text-align: center;
}

h1 {
    font-size: 100px;
    color: black;
    background-color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
    display: inline-block;
    animation: title-rotate 10s ease-in-out infinite;
}

@keyframes title-rotate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
    75% { transform: rotate(-3deg); }
    100% { transform: rotate(0deg); }
}

h2 {
    font-size: 30px;
}

.header {
    height: 100vh;
    background-color: #b3463a;
    padding: 40px 20px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: radial-gradient(white 4px, transparent 4px);
    background-size: 50px 50px;
    animation: moveDots 5s linear infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes moveDots {
    0% {transform: translate(0, 0); }
    100% { transform: translate(50px, 50px);}
}

.instructions {
    background-color: white;
    color: black;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.instructions h2 {
    text-align: center;
    margin-bottom: 10px;
}

.instructions li {
    margin-bottom: 8px;
}

.game-page {
    background-color: #f0d9d7;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    min-height: 100vh;
}

.game {
    width: 90%;
    height: 90%;
    margin: 0;
    background-color: #f0d9d7;
    padding: 50px;
    border-radius: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    display: flex;
}

#word-box {
    font-size: 9rem;
    margin: 20px 0;
    
}

#word-box.bounce {
    animation: bounce 0.5s;
}

@keyframes bounce {
    0% { transform: translateY(-10px); }
    50% { transform: translateY(5px); }
    100% { transform: translateY(0); }
}

.buttons button, #next {
    background-color: #b3463a;
    color: #e9a39c;
    padding: 20px 40px;
    margin: 10px;
    font-size: 1.7rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.buttons button:hover, #next:hover {
    transform: scale(1.1);
    background-color: #943a30;
}

#feedback {
    margin: 15px 0;
    font-size: 1.5rem;
    min-height: 1.5em;
}

h3 {
    color: #e9a39c;
    font-size: 30px;
}

h3 a {
    color: inherit;
    text-decoration: none;
}

h3 a:hover {
    text-decoration: underline;
}
#score {
    font-size: 2.5rem;
    color: black;
}

#progress-container {
    width: 80%;
    height: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: #b3463a;
    transition: width 0.5s ease;
}

#restart {
    background-color: #b3463a;
    color: #e9a39c;
    padding: 15px 30px;
    margin: 10px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

#restart:hover {
    transform: scale(1.1);
    background-color: #943a30;
}

#highScore {
    color: black;
}

.new-highscore {
    color: gold;
    font-weight: bold;
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.6; transform: scale(1.1); }
}