@font-face {
    font-family: 'Lora';
    src: url('../assets/fonts/Lora-VariableFont_wght.ttf') format('truetype');
}

body {
    background-color: #f0f5d4;
    font-family: 'Lora', serif;
    color: #2c3e50;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    box-sizing: border-box;
    overflow: hidden;
}

.back-arrow {
    position: absolute;
    top: 20px;
    left: 30px;
    font-size: 3rem;
    color: #006400;
    text-decoration: none;
    font-weight: bold;
}

.page-title {
    font-size: 2.2rem;
    font-weight: normal;
    margin: 0 0 1rem 0;
}

.typing-container {
    width: 80%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.settings-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background-color: #38541d;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    color: white;
    flex-wrap: wrap;
}

.setting-toggle, .option-button {
    color: white;
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    border-radius: 20px;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.separator {
    color: white;
    font-size: 1.5rem;
    font-weight: 100;
    opacity: 0.7;
}

.setting-toggle.active, .option-button.active {
    color: #6AF65A;
    font-weight: 700;
}

.setting-toggle:not(.active):hover, .option-button:not(.active):hover {
    color: #c0c0c0;
}

.timer {
    font-size: 1.2rem;
    color: #333;
}

#text-display {
    font-size: 1.8rem;
    line-height: 1.6;
    height: 4.8em;
    overflow: hidden;
    text-align: justify;
    color: #999;
}

#text-display span {
    position: relative;
}

#text-display span.correct { color: #1e8449; }
#text-display span.incorrect { color: #c0392b; }

#text-display span.current::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #f1c40f;
}

#text-display span.current.descender::after {
    bottom: -5px;
}


.hands-and-restart {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 2rem;
    gap: 3rem;
}

.hand {
    position: relative; /* This is crucial for layering the fingers */
    width: 250px;
    height: 250px;
    flex-shrink: 0;
}

.base-hand {
    width: 100%;
}

/* THIS WAS THE MISSING PIECE */
.finger {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* All fingers are hidden by default */
}

.restart-button {
    background-color: #e0e0e0;
    border: 2px solid #555;
    color: #333;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}