:root {
    --primary: #2e7d32;
    --primary-dark: #1b5e20;
    --gold: #d4af37;
    --gold-light: #ffcc00;
    --bg: #f4f7f6;
    --white: #ffffff;
}

body {
    margin: 0;
    font-family: 'Amiri', serif !important;
    background: var(--bg);
    color: #333;
    -webkit-tap-highlight-color: transparent;
}

/* --- Navigation --- */
nav {
    background: var(--primary);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.nav-left { display: flex; gap: 12px; }

.nav-left button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-ar {
    font-size: 1.8rem;
    color: white;
    font-weight: bold;
    line-height: 1.2;
}

.title-en {
    font-size: 0.75rem;
    color: var(--gold-light);
    letter-spacing: 1.5px;
    font-weight: bold;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.streak-box {
    background: rgba(0,0,0,0.3);
    padding: 5px 12px;
    border-radius: 20px;
    color: var(--gold-light);
    font-weight: bold;
    border: 1px solid var(--gold);
}

#review-btn {
    background: var(--gold);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* --- Stats --- */
#stats-container {
    padding: 20px;
    background: var(--white);
    border-bottom: 2px solid #eee;
}

.progress-container {
    width: 100%;
    background: #e0e0e0;
    height: 14px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

#progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

#progress-text {
    font-weight: bold;
    color: var(--primary-dark);
    margin: 0;
    font-size: 1rem;
}

#share-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: bold;
}

.goal-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

/* --- Intro / Basmalah --- */
.basmalah-container {
    text-align: center;
    padding: 30px 10px;
    background: white;
    border-bottom: 1px solid #eee;
}

.taawuz {
    font-size: 1.3rem;
    color: #999;
    margin-bottom: 10px;
}

.basmalah {
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: bold;
}

/* --- Verse Grid: KEEPING LIVE UI SAME --- */
.verse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 15px;
    padding: 25px;
}

.verse-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2.5px solid var(--primary);
    background: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.verse-btn.completed {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(46,125,50,0.3);
}

/* --- Quest Modal --- */
.quest-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.78);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 15px;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 620px;
    border-radius: 28px;
    padding: 36px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.modal-content h2 {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
}

#mag-box {
    height: 140px;
    font-size: 4.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--gold);
    border-radius: 20px;
    margin: 15px 0;
    background: #fff;
    color: var(--primary);
    font-family: 'Amiri', serif;
}

#words-box {
    font-size: 2.6rem;
    direction: rtl;
    min-height: 140px;
    line-height: 1.8;
    background: #fcfcfc;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

#words-box.scramble-active {
    border: 3px dashed var(--gold);
    background: #fffdf5;
}

.action-btn,
#play-full {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    margin: 6px;
    transition: 0.2s;
}

.action-btn:hover,
#play-full:hover {
    transform: translateY(-1px);
    background: var(--primary-dark);
}

.primary-btn {
    background: var(--primary);
    color: white;
}

/* --- Guiding Arrow --- */
.arrow-hint {
    position: absolute;
    left: -40px;
    top: 12px;
    font-size: 2.5rem;
    animation: bounceRight 0.8s infinite;
    z-index: 10;
}

@keyframes bounceRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(12px); }
}

/* --- Scramble --- */
#scramble-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    direction: rtl;
    padding-bottom: 20px;
}

.scramble-word-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 30px;
    font-size: 1.6rem;
    font-family: 'Amiri', serif;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* --- Community Section: Added Around Existing UI --- */
.community-section {
    padding: 38px 20px;
    text-align: center;
    background: #ffffff;
    border-top: 1px solid #eee;
}

.live-now {
    max-width: 680px;
    margin: 0 auto 32px auto;
    padding: 22px 18px;
    background: #f8fff8;
    border: 1.5px solid var(--primary);
    border-radius: 18px;
}

.live-now h2,
.community-section h2 {
    color: var(--primary);
    margin-bottom: 10px;
}

.community-section h3 {
    color: var(--primary-dark);
    margin-top: 28px;
    margin-bottom: 10px;
}

.community-section p {
    color: #555;
    line-height: 1.8;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.community-section .highlight,
.live-now .highlight {
    color: var(--gold);
    font-weight: bold;
    font-size: 1.35rem;
    line-height: 1.6;
    text-align: center;
}

.community-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    color: white !important;
    display: inline-block;
    cursor: pointer;
}

.btn.primary {
    background: var(--primary);
}

.btn.whatsapp {
    background: #25D366;
}

.btn.youtube {
    background: #FF0000;
}

.project-note {
    margin-top: 20px;
    font-size: 0.85rem !important;
    color: #888 !important;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 16px;
    background: var(--primary-dark);
    color: white;
    font-size: 0.9rem;
}

/* --- Mobile Fixes: KEEP GRID SAME STYLE --- */
@media (max-width: 500px) {
    #mag-box {
        font-size: 3rem;
        height: 100px;
    }

    #words-box {
        font-size: 1.8rem;
        min-height: 110px;
    }

    .modal-content {
        padding: 24px;
        border-radius: 24px;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .title-ar {
        font-size: 1.5rem;
    }

    .basmalah {
        font-size: 2rem;
    }

    .verse-grid {
        padding: 15px;
        gap: 10px;
    }

    .community-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 90%;
        max-width: 280px;
    }
}