/* --- Pre-game Loader --- */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #4f46e5;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Game Progress Bars --- */
.progress-bar-container {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.progress-bar-container span {
    padding: 0 1rem;
    font-weight: 600;
    color: #4b5563;
}

.progress-bar {
    height: 30px;
    width: 0%;
    border-radius: 0.5rem;
    transition: width 0.2s linear;
}

.progress-bar.player {
    background-color: #4ade80;
    /* Green */
}

.progress-bar.opponent {
    background-color: #f87171;
    /* Red */
}

/* --- Typing Area --- */
#text-display {
    height: 120px;
    overflow: hidden;
    line-height: 2.5rem;
    scroll-behavior: smooth;
}

.word.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 2px;
    bottom: 2px;
    width: 2px;
    background-color: #4f46e5;
    animation: blink 1s infinite;
}

.word {
    position: relative;
    display: inline-block;
    margin-right: 0.5rem;
}

.letter.correct {
    color: #10b981;
}

.letter.incorrect {
    color: #ef4444;
    text-decoration: underline;
}

/* --- How-to Steps & FAQ (Consistent Styling) --- */
.step-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    font-size: 3rem;
}

.step-icon-1 {
    background-color: #e0f2fe;
    color: #0ea5e9;
}

.step-icon-2 {
    background-color: #e0e7ff;
    color: #4338ca;
}

.step-icon-3 {
    background-color: #dcfce7;
    color: #22c55e;
}

.faq-entry {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.faq-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.faq-answer p {
    color: #4b5563;
    line-height: 1.6;
}