* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ══════════════════════════════════════════
               THEME TOKENS
            ══════════════════════════════════════════ */
:root {
    /* DARK THEME (default) — warm jewel tones */
    --bg: #0d0e14;
    --bg2: #13141c;
    --bg3: #1a1c27;
    --surface: #1f2133;
    --surface2: #252840;

    --gold: #e8a838;
    --gold-light: #f5c46a;
    --gold-pale: rgba(232, 168, 56, 0.14);
    --gold-border: rgba(232, 168, 56, 0.28);
    --gold-border-strong: rgba(232, 168, 56, 0.55);

    --teal: #3dd6c8;
    --teal-pale: rgba(61, 214, 200, 0.1);
    --teal-border: rgba(61, 214, 200, 0.3);

    --rose: #ff7f96;
    --rose-pale: rgba(255, 127, 150, 0.1);
    --rose-border: rgba(255, 127, 150, 0.3);

    --cream: #ede6d4;
    --cream-soft: #c0b89e;
    --cream-muted: #7a7265;

    --green-light: #52d49a;
    --red-light: #ff7070;
    --yellow-light: #f5c46a;

    --text-heading: #ffffff;
    --text-body: #ede6d4;
    --card-bg: var(--surface);
    --card-border: var(--gold-border);

    --ghadeer-img: url('/images/ghadeer.jpg');

    /* progress bar fills */
    --prog-from: var(--gold);
    --prog-to: var(--teal);
}

/* NIGHT (extra dark, cooler blue) */
[data-theme='night'] {
    --bg: #07080e;
    --bg2: #0c0d15;
    --bg3: #11121d;
    --surface: #161828;
    --surface2: #1b1e32;

    --gold: #b8883a;
    --gold-light: #d4a45a;
    --gold-pale: rgba(184, 136, 58, 0.12);
    --gold-border: rgba(184, 136, 58, 0.22);
    --gold-border-strong: rgba(184, 136, 58, 0.42);

    --teal: #2ab8ac;
    --teal-pale: rgba(42, 184, 172, 0.09);
    --teal-border: rgba(42, 184, 172, 0.25);

    --rose: #d96070;
    --rose-pale: rgba(217, 96, 112, 0.09);
    --rose-border: rgba(217, 96, 112, 0.25);

    --cream: #ccc5b4;
    --cream-soft: #999080;
    --cream-muted: #5e5850;

    --green-light: #3ab87a;
    --red-light: #d45555;
    --yellow-light: #d4a45a;

    --text-heading: #e0d8c8;
    --text-body: #ccc5b4;
    --card-bg: var(--surface);
    --card-border: var(--gold-border);
}

/* LIGHT THEME — warm ivory + vibrant accents */
[data-theme='light'] {
    --bg: #fdf8ef;
    --bg2: #f7f0e2;
    --bg3: #ede6d4;
    --surface: #ffffff;
    --surface2: #f4ede0;

    --gold: #c87c1a;
    --gold-light: #e09228;
    --gold-pale: rgba(200, 124, 26, 0.1);
    --gold-border: rgba(200, 124, 26, 0.25);
    --gold-border-strong: rgba(200, 124, 26, 0.5);

    --teal: #0d8c80;
    --teal-pale: rgba(13, 140, 128, 0.08);
    --teal-border: rgba(13, 140, 128, 0.25);

    --rose: #d9445e;
    --rose-pale: rgba(217, 68, 94, 0.08);
    --rose-border: rgba(217, 68, 94, 0.25);

    --cream: #2a2318;
    --cream-soft: #5a4e3c;
    --cream-muted: #9a8e7c;

    --green-light: #107a50;
    --red-light: #c03030;
    --yellow-light: #b86c00;

    --text-heading: #1a140a;
    --text-body: #2a2318;
    --card-bg: #ffffff;
    --card-border: var(--gold-border);
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}
body {
    font-family: 'Barlow', sans-serif;
    background: var(--bg);
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
    transition:
        background 0.35s ease,
        color 0.35s ease;
}

/* ══════════════════════════════════════════
               THEME TOGGLE BUTTON
            ══════════════════════════════════════════ */
.theme-fab {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 300;
    display: flex;
    gap: 4px;
    background: var(--bg2);
    border: 1px solid var(--gold-border);
    border-radius: 30px;
    padding: 4px 6px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
    transition:
        background 0.3s,
        border-color 0.3s;
}
.theme-btn {
    width: 34px;
    height: 28px;
    border-radius: 22px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition:
        background 0.2s,
        transform 0.15s;
    color: var(--cream-soft);
}
.theme-btn:hover {
    transform: scale(1.15);
}
.theme-btn.active {
    background: var(--gold-pale);
    color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold-border);
}
.theme-btn-label {
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    display: block;
    text-align: center;
    color: inherit;
    margin-top: 1px;
    font-family: 'Barlow', sans-serif;
    line-height: 1;
}
.theme-btn-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

/* ══════════════════════════════════════════
               PROGRESS
            ══════════════════════════════════════════ */
.progress-line {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-pale);
    z-index: 100;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--teal));
    transition: width 0.6s ease;
    width: 0%;
    border-radius: 0 2px 2px 0;
}

/* ══════════════════════════════════════════
               SCREENS
            ══════════════════════════════════════════ */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}
.screen.active {
    display: flex;
    flex-direction: column;
}
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.screen.active > * {
    animation: fadeUp 0.65s ease both;
}
.screen.active > *:nth-child(1) {
    animation-delay: 0.05s;
}
.screen.active > *:nth-child(2) {
    animation-delay: 0.15s;
}
.screen.active > *:nth-child(3) {
    animation-delay: 0.25s;
}
.screen.active > *:nth-child(4) {
    animation-delay: 0.35s;
}
.screen.active > *:nth-child(5) {
    animation-delay: 0.45s;
}

/* ══════════════════════════════════════════
               HERO
            ══════════════════════════════════════════ */
#screen-hero {
    padding: 0;
    background: radial-gradient(ellipse at 50% 20%, #1a1c2e 0%, var(--bg) 70%);
    overflow: hidden;
}
[data-theme='light'] #screen-hero {
    background: radial-gradient(ellipse at 50% 20%, #f0e8d0 0%, var(--bg) 70%);
}
.hero-img-strip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    background-image: var(--ghadeer-img);
    background-size: cover;
    background-position: center 0%;
    -webkit-mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.5) 55%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.5) 55%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: 3rem 1.5rem;
    min-height: 100vh;
}
.hero-content .hero-verse-box {
    margin-top: auto;
}

.hero-verse-box {
    background: rgba(13, 14, 20, 0.85);
    border: 1px solid var(--gold-border-strong);
    border-radius: 14px;
    padding: 2rem 1.75rem;
    max-width: 600px;
    width: 100%;
    margin-bottom: 2rem;
    backdrop-filter: blur(8px);
    position: relative;
    transition: border-color 0.3s;
}
[data-theme='light'] .hero-verse-box {
    background: rgba(255, 252, 245, 0.92);
    box-shadow: 0 8px 40px rgba(200, 124, 26, 0.12);
}
.hero-verse-box::before,
.hero-verse-box::after {
    content: '';
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero-verse-box::before {
    top: 0;
}
.hero-verse-box::after {
    bottom: 0;
}

.hero-surah-ref {
    font-size: 0.62rem;
    letter-spacing: 0.4em;
    color: var(--teal);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    font-weight: 500;
}
.hero-arabic {
    font-family: 'Amiri', serif;
    font-size: clamp(1.8rem, 5.5vw, 2.8rem);
    color: var(--text-heading);
    direction: rtl;
    line-height: 2.1;
    margin-bottom: 1.25rem;
}
.hero-divider {
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto 1.25rem;
}
.hero-english {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(0.95rem, 2.8vw, 1.1rem);
    color: var(--cream-soft);
    font-style: italic;
    line-height: 1.9;
}
.hero-prompt {
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
    color: var(--cream-soft);
    line-height: 1.7;
    max-width: 380px;
    margin: 0 auto 2rem;
    font-weight: 300;
}
.hero-prompt em {
    color: var(--gold-light);
    font-style: normal;
    font-weight: 500;
}

/* ══════════════════════════════════════════
               BUTTONS
            ══════════════════════════════════════════ */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0d0e14;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 1rem 2.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(232, 168, 56, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(232, 168, 56, 0.45);
    filter: brightness(1.08);
}
.btn-continue {
    background: transparent;
    border: 1px solid var(--gold-border-strong);
    color: var(--gold-light);
    font-family: 'Barlow', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-continue:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════
               HADITH SCREEN
            ══════════════════════════════════════════ */
#screen-hadith {
    padding: 0;
    background: var(--bg2);
}
.hadith-hero {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--gold-border);
}
.hadith-img-strip {
    width: 100%;
    height: 280px;
    background-image: var(--ghadeer-img);
    background-size: cover;
    background-position: center 0%;
    -webkit-mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 35%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 35%,
        transparent 100%
    );
    flex-shrink: 0;
}
.connecting-statement {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.86rem;
    color: var(--cream-soft);
    font-style: italic;
    line-height: 1.9;
    max-width: 520px;
    margin: 0 auto 2.5rem;
}

/* Tooltip */
.tooltip-wrap {
    display: inline;
    position: relative;
}
.tooltip-trigger {
    color: var(--teal);
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
}
.tooltip-box {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface2);
    border: 1px solid var(--teal-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    min-width: 220px;
    text-align: left;
    z-index: 50;
    font-style: normal;
    font-family: 'Barlow', sans-serif;
    white-space: normal;
}
.tooltip-wrap.open .tooltip-box {
    display: block;
}
.tooltip-box li {
    font-size: 0.72rem;
    color: var(--cream-soft);
    padding: 0.2rem 0;
    list-style: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.tooltip-box li:last-child {
    border: none;
}

/* Hadith Card */
.hadith-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 2rem 1.5rem;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    transition:
        background 0.3s,
        border-color 0.3s;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}
[data-theme='light'] .hadith-card {
    box-shadow: 0 4px 30px rgba(200, 124, 26, 0.08);
}
.hadith-card::before,
.hadith-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hadith-card::before {
    top: 0;
    border-radius: 10px 10px 0 0;
}
.hadith-card::after {
    bottom: 0;
    border-radius: 0 0 10px 10px;
}
.hadith-lines {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gold-border);
}
.hadith-line-pair {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(232, 168, 56, 0.08);
}
.hadith-line-pair:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.hadith-line-ar {
    font-family: 'Amiri', serif;
    font-size: clamp(1.25rem, 3.8vw, 1.55rem);
    direction: rtl;
    text-align: right;
    line-height: 1.9;
    color: var(--text-heading);
    display: block;
    margin-bottom: 0.4rem;
}
.hadith-line-en {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.88rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--cream-soft);
    display: block;
    text-align: left;
}
.hadith-response-pair {
    text-align: center;
    margin: 0 0 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(232, 168, 56, 0.08);
}
.hadith-response-ar {
    font-family: 'Amiri', serif;
    font-size: 1rem;
    color: var(--teal);
    font-style: italic;
    display: block;
}
.hadith-response-en {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.78rem;
    color: var(--teal);
    font-style: italic;
    display: block;
    margin-top: 0.2rem;
}
.hadith-attribution {
    font-size: 0.68rem;
    color: var(--cream-muted);
    letter-spacing: 0.04em;
    line-height: 1.8;
    text-align: center;
}
.hadith-attribution span {
    color: var(--cream-soft);
}
.hadith-footer {
    padding: 1.5rem;
    text-align: center;
}

/* ══════════════════════════════════════════
               QUESTION SCREENS
            ══════════════════════════════════════════ */
.q-screen {
    padding: 2rem 1.5rem;
    max-width: 580px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}
.stage-badge {
    display: inline-block;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--teal);
    border: 1px solid var(--teal-border);
    background: var(--teal-pale);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
}
.q-text {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    color: var(--text-heading);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-weight: 400;
}
.options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.opt-btn {
    background: var(--card-bg);
    border: 1px solid var(--surface2);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.22s;
    width: 100%;
    min-height: 56px;
}
.opt-btn:hover {
    border-color: var(--gold-border-strong);
    background: var(--bg3);
    transform: translateX(4px);
    box-shadow: -3px 0 0 var(--gold);
}
.opt-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--gold-border);
    background: var(--gold-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--gold);
    flex-shrink: 0;
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    transition: background 0.2s;
}
.opt-btn:hover .opt-letter {
    background: var(--gold);
    color: #0d0e14;
}
.opt-text {
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.5;
    font-weight: 400;
}

/* ══════════════════════════════════════════
               DEAD END SCREENS
            ══════════════════════════════════════════ */
.de-screen {
    padding: 2rem 1.5rem 3rem;
    max-width: 580px;
    margin: 0 auto;
    width: 100%;
}
.de-opening {
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    color: var(--cream-soft);
    font-style: italic;
    line-height: 1.9;
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--gold-border);
}
.arg-block {
    background: var(--card-bg);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1rem;
    transition: background 0.3s;
}
.arg-heading {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.35rem;
    font-family: 'Barlow', sans-serif;
}
.arg-subheading {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.6rem;
    font-family: 'Libre Baskerville', serif;
}
.arg-body {
    font-size: 0.9rem;
    color: var(--cream-soft);
    line-height: 1.85;
    font-weight: 300;
}
.arg-body em {
    font-family: 'Amiri', serif;
    color: var(--gold-light);
    font-style: italic;
    font-size: 1.05rem;
}
.arg-body strong {
    color: var(--text-body);
    font-weight: 500;
}
.arg-finisher {
    display: block;
    margin-top: 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    line-height: 1.6;
}
.source-row {
    margin-top: 0.85rem;
}
.source-label {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cream-muted);
    margin-bottom: 0.4rem;
    display: block;
}
.source-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.source-tag {
    font-size: 0.65rem;
    color: var(--cream-muted);
    background: var(--bg3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    padding: 0.2rem 0.5rem;
    font-style: italic;
}
[data-theme='light'] .source-tag {
    background: var(--bg3);
    border-color: var(--gold-border);
    color: var(--cream-soft);
}

/* Stat Row */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin: 1.25rem 0;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 0.9rem 0.5rem;
    text-align: center;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(232, 168, 56, 0.15);
}
.stat-num {
    font-family: 'Amiri', serif;
    font-size: 1.7rem;
    color: var(--gold);
    display: block;
    line-height: 1.2;
}
.stat-label {
    font-size: 0.58rem;
    color: var(--cream-muted);
    letter-spacing: 0.04em;
    line-height: 1.4;
    margin-top: 0.2rem;
}

/* Info Panel */
.info-panel {
    background: var(--bg3);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    transition: background 0.3s;
}
.info-panel-title {
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.75rem;
}
.narrator-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.narrator-chip {
    font-size: 0.74rem;
    color: var(--cream-soft);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    padding: 0.2rem 0.55rem;
    transition: background 0.2s;
}
[data-theme='light'] .narrator-chip {
    background: var(--bg2);
    border-color: var(--gold-border);
}
.narrator-chip:hover {
    background: var(--gold-pale);
    color: var(--gold);
}
.scholar-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.scholar-chip {
    font-size: 0.74rem;
    color: var(--teal);
    background: var(--teal-pale);
    border: 1px solid var(--teal-border);
    border-radius: 4px;
    padding: 0.2rem 0.6rem;
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
}
.quote-block {
    border-left: 2px solid var(--rose-border);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: var(--rose-pale);
    border-radius: 0 6px 6px 0;
}
.quote-attribution {
    font-size: 0.65rem;
    color: var(--rose);
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}
.quote-text {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--cream-soft);
    line-height: 1.7;
}

/* ══════════════════════════════════════════
               NUDGE BUTTON
            ══════════════════════════════════════════ */
.nudge-btn {
    width: 100%;
    background: var(--gold-pale);
    border: 1px solid var(--gold-border-strong);
    border-radius: 10px;
    padding: 1rem 1rem 1rem 1.2rem;
    text-align: left;
    cursor: pointer;
    margin-top: 1.25rem;
    transition: all 0.22s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.nudge-btn:hover {
    background: rgba(232, 168, 56, 0.22);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(232, 168, 56, 0.2);
}
.nudge-btn:active {
    transform: translateY(0);
}
.nudge-content {
    flex: 1;
}
.nudge-label {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(232, 168, 56, 0.6);
    margin-bottom: 0.35rem;
}
.nudge-text {
    font-size: 0.88rem;
    color: var(--gold);
    line-height: 1.6;
    font-weight: 300;
    display: block;
}
.nudge-arrow {
    color: var(--gold);
    font-size: 1.3rem;
    flex-shrink: 0;
    opacity: 0.85;
}

/* ══════════════════════════════════════════
               STAGE 4 MESSAGE
            ══════════════════════════════════════════ */
.s4-message {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.95rem;
    color: var(--cream-soft);
    font-style: italic;
    line-height: 1.9;
    background: var(--card-bg);
    border: 1px solid var(--gold-border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    transition: background 0.3s;
}

/* ══════════════════════════════════════════
               FLOWCHART
            ══════════════════════════════════════════ */
.flowchart {
    padding: 2rem 1.5rem 1rem;
    max-width: 580px;
    margin: 0 auto;
    width: 100%;
}
.flowchart-title {
    font-size: 1.25rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 500;
}
.fc-stage {
    margin-bottom: 0.5rem;
}
.fc-stage-label {
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cream-muted);
    margin-bottom: 0.4rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--gold-border);
}
.fc-node {
    background: var(--card-bg);
    border: 1px solid var(--surface2);
    border-radius: 6px;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    color: var(--cream-soft);
    line-height: 1.4;
    font-weight: 300;
    transition: background 0.3s;
}
.fc-node.corrected {
    border-color: rgba(61, 214, 200, 0.35);
    background: rgba(61, 214, 200, 0.07);
    color: var(--green-light);
}
.fc-node.wrong {
    margin-left: 1.5rem;
}
.fc-connector {
    width: 2px;
    height: 22px;
    background: linear-gradient(180deg, var(--gold-border), transparent);
    margin: 0 auto 0 24px;
}
.fc-connector.wrong {
    margin-left: calc(1.5rem + 24px);
}
.fc-node-final {
    border-radius: 8px;
    padding: 1rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.fc-node-final.green {
    background: rgba(61, 214, 200, 0.1);
    border: 1px solid rgba(61, 214, 200, 0.35);
    color: var(--green-light);
}
.fc-node-final.red {
    background: rgba(255, 112, 112, 0.1);
    border: 1px solid rgba(255, 112, 112, 0.3);
    color: var(--red-light);
}
.fc-node-final.yellow {
    background: rgba(245, 196, 106, 0.1);
    border: 1px solid rgba(245, 196, 106, 0.3);
    color: var(--yellow-light);
}
.fc-node-final.wrong {
    margin-left: 1.5rem;
}
.fc-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
               FINAL / CLOSING
            ══════════════════════════════════════════ */
.final-img-bg {
    position: absolute;
    inset: 0;
    background-image: var(--ghadeer-img);
    background-size: cover;
    background-position: center center;
    z-index: 0;
}
.final-img-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 11, 17, 0.78);
}
[data-theme='light'] .final-img-bg::after {
    background: rgba(253, 248, 239, 0.85);
}
#screen-final {
    position: relative;
    overflow: hidden;
}
#screen-final .flowchart,
#screen-final .closing-section {
    position: relative;
    z-index: 1;
}

.closing-section {
    padding: 0 1.5rem 3rem;
    max-width: 580px;
    margin: 0 auto;
    width: 100%;
}
.closing-divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold-border),
        transparent
    );
    margin-bottom: 2rem;
}
.closing-ornament {
    text-align: center;
    color: var(--gold);
    font-size: 1.2rem;
    opacity: 0.6;
    letter-spacing: 0.5em;
    margin-bottom: 1.5rem;
}
.closing-message {
    text-align: center;
    padding: 0 0.5rem;
}
.closing-msg-main {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(1.15rem, 3.5vw, 1.3rem);
    color: var(--text-heading);
    line-height: 1.85;
    font-style: italic;
    margin-bottom: 1.75rem;
}
.closing-msg-dua {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(0.92rem, 2.5vw, 1rem);
    color: var(--cream-soft);
    line-height: 2;
    font-style: italic;
    font-weight: 300;
}
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 2rem auto 0;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0d0e14;
    font-family: 'Barlow', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.9rem 1.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.22s;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 4px 20px rgba(232, 168, 56, 0.3);
}
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(232, 168, 56, 0.45);
    filter: brightness(1.08);
}
.restart-btn {
    display: block;
    margin: 1.25rem auto 0;
    background: transparent;
    border: 1px solid var(--surface2);
    color: var(--cream-muted);
    font-family: 'Barlow', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    padding: 0.65rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.restart-btn:hover {
    border-color: var(--gold-border);
    color: var(--gold);
}

/* ══════════════════════════════════════════
               SHARE MODAL
            ══════════════════════════════════════════ */
.share-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}
.share-modal.open {
    display: flex;
}
.share-inner {
    width: min(300px, 55vw);
    aspect-ratio: 9/16;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gold-border);
}
.share-actions {
    display: flex;
    gap: 0.75rem;
    width: min(300px, 55vw);
}
.share-action-btn {
    flex: 1;
    padding: 0.7rem 0;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Barlow', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.share-action-btn.save {
    background: var(--surface);
    border: 1px solid var(--surface2);
    color: var(--cream-soft);
}
.share-action-btn.save:hover {
    border-color: var(--gold-border);
    color: var(--cream);
}
.share-action-btn.share {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border: none;
    color: #0d0e14;
    font-weight: 600;
}
.share-action-btn.share:hover {
    filter: brightness(1.1);
}
.share-close-row {
    width: min(300px, 55vw);
    text-align: right;
}
.share-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--cream-muted);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    padding: 0.35rem 0.75rem;
    border-radius: 2px;
    cursor: pointer;
    font-family: 'Barlow', sans-serif;
    transition: all 0.2s;
}
.share-close:hover {
    border-color: var(--gold-border);
    color: var(--gold);
}

/* ══════════════════════════════════════════
               UTILITIES
            ══════════════════════════════════════════ */
.mt-1 {
    margin-top: 0.75rem;
}
.mt-2 {
    margin-top: 1.25rem;
}

/* Decorative glow for dark themes */
[data-theme='dark'] #screen-hero::before,
[data-theme='night'] #screen-hero::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(232, 168, 56, 0.07) 0%,
        transparent 70%
    );
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    pointer-events: none;
    z-index: 1;
}

/* ══════════════════════════════════════════
               RESPONSIVE — TABLET
            ══════════════════════════════════════════ */
@media (min-width: 640px) {
    .q-screen {
        padding: 2.5rem 2rem;
    }
    .de-screen {
        padding: 2.5rem 2rem 3.5rem;
    }
    .hadith-hero {
        padding: 3rem 2rem 2.5rem;
    }
    .hadith-card {
        padding: 2.5rem 2rem;
    }
    .hadith-img-strip {
        height: 360px;
    }
    .flowchart {
        padding: 2.5rem 2rem 1rem;
    }
    .closing-section {
        padding: 0 2rem 3.5rem;
    }
    .stat-num {
        font-size: 2rem;
    }
    .stat-label {
        font-size: 0.65rem;
    }
    .connecting-statement {
        font-size: 0.9rem;
    }
    .theme-fab {
        top: 18px;
        right: 18px;
    }
}

/* ══════════════════════════════════════════
               RESPONSIVE — DESKTOP
            ══════════════════════════════════════════ */
@media (min-width: 900px) {
    .hero-img-strip {
        height: 70%;
    }
    .hero-content {
        flex-direction: row !important;
        align-items: center;
        justify-content: center;
        gap: 4rem;
        text-align: left !important;
        max-width: 1100px;
        margin: 0 auto;
        padding: 4rem 2rem !important;
        min-height: 100vh;
    }
    .hero-verse-box {
        max-width: 520px;
        flex-shrink: 0;
        margin-bottom: 0;
        text-align: center;
    }
    .hero-arabic {
        font-size: 2.4rem;
    }
    .hero-english {
        font-size: 1.05rem;
    }
    .hero-right {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        max-width: 380px;
    }
    .hero-prompt {
        text-align: left;
        margin: 0 0 2rem;
        max-width: none;
        font-size: 1.05rem;
    }
    .hadith-hero {
        padding: 3.5rem 3rem 2.5rem;
    }
    .connecting-statement {
        font-size: 0.95rem;
        max-width: 680px;
    }
    .hadith-card {
        max-width: 720px;
        padding: 2.5rem 2.5rem;
    }
    .hadith-img-strip {
        height: 400px;
        background-position: center 0%;
    }
    .q-screen {
        max-width: 680px;
        padding: 3rem 2rem;
    }
    .q-text {
        font-size: 1.5rem;
    }
    .opt-text {
        font-size: 0.95rem;
    }
    .opt-btn {
        padding: 1.1rem 1.25rem;
    }
    .de-screen {
        max-width: 780px;
        padding: 3rem 2rem 4rem;
    }
    .de-opening {
        font-size: 1.05rem;
    }
    .arg-body {
        font-size: 0.95rem;
    }
    .arg-finisher {
        font-size: 1rem;
    }
    .stat-num {
        font-size: 2.2rem;
    }
    .stat-label {
        font-size: 0.68rem;
    }
    .flowchart {
        max-width: 680px;
        padding: 3rem 2rem 1rem;
    }
    .fc-node {
        font-size: 0.85rem;
        padding: 0.75rem 1.1rem;
    }
    .fc-node-final {
        font-size: 0.92rem;
        padding: 1.1rem 1.4rem;
    }
    .closing-section {
        max-width: 680px;
        padding: 0 2rem 4rem;
    }
    .closing-msg-main {
        font-size: 1.35rem;
    }
    .closing-msg-dua {
        font-size: 1.05rem;
    }
    .s4-message {
        font-size: 1rem;
    }
    .share-inner {
        width: min(400px, 45vw);
    }
    .share-actions {
        width: min(400px, 45vw);
    }
    .share-close-row {
        width: min(400px, 45vw);
    }
    .theme-fab {
        top: 22px;
        right: 22px;
    }
}

.theme-toggle {
    position: fixed;
    bottom: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gold-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 300;
    font-size: 1.1rem;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

[data-theme='light'] .theme-toggle,
[data-theme='light'] .lang-selector {
    background: rgba(0, 0, 0, 0.03);
}

.theme-toggle:hover {
    transform: scale(1.08);
}

.lang-container {
    position: fixed;
    top: 14px;
    right: 56px;
    z-index: 300;
}

.lang-selector {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gold-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.lang-selector:hover {
    transform: scale(1.08);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 6px 0;
    min-width: 140px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show on hover of the container */
.lang-container:hover .lang-dropdown,
.lang-container:focus-within .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    padding: 8px 16px;
    color: var(--cream-soft);
    text-decoration: none;
    font-size: 0.88rem;
    font-family: 'Barlow', sans-serif;
    transition: all 0.2s ease;
    text-align: left;
}

.lang-option:hover {
    background: var(--gold-pale);
    color: var(--gold);
}

.lang-option.active {
    color: var(--gold);
    font-weight: 600;
    background: rgba(232, 168, 56, 0.08);
}
