@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
}

.typing-font {
    font-family: 'calibiri', Times, serif;
}

/* কীবোর্ড গ্রিড কন্টেইনার */
.keyboard-grid-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    padding: 24px 32px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.keyboard-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px; /* দুই হাতের মাঝে দূরত্ব */
}

.hand-group {
    display: flex;
    gap: 8px;
}

/* কীবোর্ড বাটন ক্যাপ (ছবি ২ ও ৪ এর মতো পরিষ্কার ডিজাইন) */
.kb-key {
    width: 58px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: #1e3a8a;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-bottom: 4px solid #94a3b8;
    border-radius: 12px;
    transition: all 0.08s ease;
    user-select: none;
}

/* সেন্ট্রাল স্পেস বাটন */
.kb-space-bar {
    min-width: 180px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    border: 1.5px solid #7dd3fc;
    border-bottom: 4px solid #38bdf8;
    border-radius: 14px;
    margin-top: 14px;
    cursor: default;
    transition: all 0.08s ease;
}

/* সক্রিয় বাটন */
.kb-key-active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    border-bottom: 4px solid #1e40af !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.35);
}

.kb-key-correct {
    background: #ecfdf5 !important;
    color: #16a34a !important;
    border-color: #86efac !important;
    border-bottom: 4px solid #22c55e !important;
}

.kb-key-wrong {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    border-bottom: 4px solid #ef4444 !important;
}

/* শব্দ ও অনুচ্ছেদ স্বাভাবিক ডিসপ্লে */
.word-text-display {
    font-size: 2.2rem;
    line-height: 1.9;
    letter-spacing: 0.04em;
    word-break: break-word;
    white-space: normal;
}

.char-normal-pending { color: #94a3b8; }
.char-normal-current { background-color: #2563eb; color: #ffffff !important; border-radius: 4px; padding: 0 2px; }
.char-normal-correct { color: #16a34a; }
.char-normal-wrong   { color: #dc2626; background-color: #fee2e2; border-radius: 2px; }

/* ব্লাইন্ড মোড */
.blind-text-display { font-size: 1.85rem; line-height: 2; color: #334155; user-select: none; }

/* রেড ফ্ল্যাশ */
.screen-red-flash { animation: flashRed 0.2s ease-out; }
@keyframes flashRed {
    0% { background-color: rgba(239, 68, 68, 0.25); }
    100% { background-color: transparent; }
}


/* ==========================================
   মোবাইলে কীবোর্ড অটো জুম-আউট (আরও ছোট করার জন্য)
   ========================================== */
@media (max-width: 640px) {
    .keyboard-grid-card {
        transform: scale(0.58);
        transform-origin: center top;
        margin-top: -15px;
        margin-bottom: -80px;
    }
}

@media (max-width: 400px) {
    .keyboard-grid-card {
        transform: scale(0.48);
        transform-origin: center top;
        margin-top: -25px;
        margin-bottom: -110px;
    }
}