:root {
    --bg-primary: #0b0f19;
    --bg-card: rgba(15, 23, 42, 0.92);
    --border-color: rgba(245, 158, 11, 0.25);
    --accent-gold: #f59e0b;
    --accent-gold-bright: #fbbf24;
    --accent-gold-glow: rgba(245, 158, 11, 0.4);
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-purple: #8b5cf6;
    --accent-rose: #f43f5e;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --font-heading: 'Cinzel', serif;
    --font-heading-fancy: 'Cinzel Decorative', serif;
    --font-body: 'Outfit', sans-serif;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 50% 0%, rgba(245, 158, 11, 0.18) 0px, transparent 60%),
        radial-gradient(at 15% 90%, rgba(59, 130, 246, 0.12) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.85rem;
    }
}

/* TOP INSPIRATIONAL SCRIPTURE BANNER */
.verse-banner {
    background: linear-gradient(90deg, #92400e, #f59e0b, #b45309);
    color: #0f172a;
    font-weight: 800;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.5rem 1rem;
    letter-spacing: 0.4px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* NAVBAR */
.navbar {
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-cross {
    font-size: 1.8rem;
}

.logo-text-group {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
}

.logo-accent {
    color: var(--accent-gold);
}

.logo-tagline {
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.streak-badge {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 0.4rem 0.95rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.45);
}

/* MAIN LAYOUT */
.main-content {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* GLASS CARDS & GLOW EFFECTS */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.25rem;
}

.glowing-border {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.15), inset 0 0 20px rgba(245, 158, 11, 0.05);
}

.card-shadow {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.hero-card {
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.christian-cross-header {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.cross-icon {
    font-size: 2.5rem;
    position: relative;
    z-index: 2;
}

.halo-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--accent-gold-glow) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    line-height: 1.2;
}

.hero-subtitle {
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 2rem auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* CATEGORY CARDS GRID */
.category-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .category-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .category-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }
}

.cat-card.yt-card {
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.12) 0%, rgba(15, 23, 42, 0.95) 100%);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cat-card.yt-card:hover {
    border-color: #ef4444;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.35);
    transform: translateY(-4px);
}

.cat-card.yt-card .cat-desc {
    color: #fca5a5;
    font-weight: 600;
}

.cat-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.25 ease;
    text-align: center;
}

.cat-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px var(--accent-gold-glow);
}

.cat-card.active {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.2) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 10px 30px var(--accent-gold-glow);
}

.cat-icon {
    font-size: 2rem;
    margin-bottom: 0.4rem;
}

.cat-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.cat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* CONTROLS BAR */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.35);
    padding: 1.4rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
}

.control-group label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-gold);
}

select {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    min-width: 240px;
}

select:focus {
    border-color: var(--accent-gold);
}

/* BUTTONS */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-gold-bright), #d97706);
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 4px 18px var(--accent-gold-glow);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-gold-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* QUIZ ARENA & METER */
.quiz-container {
    max-width: 840px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    gap: 1rem;
}

.percentage-meter-container {
    flex: 1;
    max-width: 250px;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-bright));
    transition: width 0.4s ease;
}

.meter-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.68rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.score-badge {
    background: rgba(16, 185, 129, 0.18);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 0.35rem 1rem;
    border-radius: 99px;
    font-weight: 700;
}

.badge-gold {
    background: rgba(245, 158, 11, 0.18);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.question-text {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 1.5rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.option-btn {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 1.15rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.15);
    transform: translateY(-2px);
}

.option-btn.correct {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border-color: #10b981 !important;
    color: white !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5);
}

.option-btn.wrong {
    background: linear-gradient(135deg, #be123c, #f43f5e) !important;
    border-color: #f43f5e !important;
    color: white !important;
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.5);
}

.answer-box {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    margin-bottom: 1.5rem;
}

.answer-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.answer-title.correct {
    color: var(--accent-emerald);
}

.answer-title.wrong {
    color: var(--accent-rose);
}

.answer-scripture {
    color: var(--accent-gold);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.answer-explanation {
    color: var(--text-secondary);
    line-height: 1.65;
}

.quiz-footer {
    display: flex;
    justify-content: space-between;
}

/* RESULTS & PERCENTAGE SCORE MODAL */
.results-card {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 2rem;
}

.results-trophy {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.results-title {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    color: var(--accent-gold);
    margin-bottom: 0.4rem;
}

.results-verse {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.percentage-score-box {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--accent-gold);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px var(--accent-gold-glow);
}

.score-number {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--accent-gold-bright);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.rank-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
    border: 1px solid var(--accent-emerald);
    padding: 0.5rem 1.5rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 1.05rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* PRINTABLE SHEET */
.printable-paper {
    background: #ffffff;
    color: #1e293b;
    padding: 2.5rem;
    border-radius: 14px;
    margin-top: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-height: 600px;
    overflow-y: auto;
}

.printable-q-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
}

/* UTILS */
.hidden {
    display: none !important;
}

.footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE & RESPONSIVE DESIGN FIXES (iPhones, Tablets & Small Screens)
   ========================================================================== */

@media (max-width: 768px) {
    /* Prevent horizontal page movement */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .container {
        padding: 0 0.85rem;
        width: 100%;
        max-width: 100%;
    }

    /* Top Scripture Banner */
    .verse-banner {
        font-size: 0.78rem;
        padding: 0.4rem 0.6rem;
        line-height: 1.35;
        word-break: break-word;
    }

    /* Navbar & Logo Clutter Fix */
    .navbar {
        position: relative; /* avoids fixed overlay clutter on small devices */
    }

    .nav-content {
        height: auto;
        padding: 0.75rem 0;
        flex-direction: column;
        gap: 0.6rem;
        align-items: center;
    }

    .logo {
        justify-content: center;
        gap: 0.6rem;
    }

    .logo-cross {
        font-size: 1.5rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-tagline {
        display: none; /* Hide secondary tagline on mobile to keep top clean */
    }

    .nav-right {
        flex-direction: column;
        gap: 0.45rem;
        width: 100%;
        align-items: center;
    }

    .streak-badge {
        font-size: 0.78rem;
        padding: 0.25rem 0.75rem;
        margin-bottom: 0.1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .nav-btn {
        padding: 0.45rem 0.55rem;
        font-size: 0.8rem;
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
        white-space: nowrap;
        border-radius: 6px;
    }

    /* Glass Cards & Layout */
    .glass {
        padding: 1.25rem 0.85rem;
        border-radius: 16px;
    }

    .hero-card {
        margin-bottom: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.25;
    }

    .hero-subtitle {
        font-size: 0.92rem;
        margin-bottom: 1.25rem;
    }

    /* Controls Bar & Dropdowns */
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 1rem 0.75rem;
        width: 100%;
    }

    .control-group {
        width: 100%;
    }

    select {
        width: 100%;
        min-width: 0 !important;
        font-size: 0.9rem;
        padding: 0.65rem 0.75rem;
    }

    #btn-start-quiz {
        width: 100%;
        justify-content: center;
        font-size: 1rem;
        padding: 0.85rem 1rem;
    }

    /* Quiz Player Arena */
    .quiz-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: space-between;
    }

    .percentage-meter-container {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 0.4rem;
    }

    .question-text {
        font-size: 1.2rem;
        margin-bottom: 1.25rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .option-btn {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
        width: 100%;
        text-align: left;
    }

    .quiz-footer {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .quiz-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Results Modal */
    .results-card {
        padding: 1.5rem 0.85rem;
        width: 100%;
    }

    .results-title {
        font-size: 1.8rem;
    }

    .score-number {
        font-size: 3.2rem;
    }

    .results-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .results-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .verse-banner {
        font-size: 0.74rem;
        padding: 0.35rem 0.4rem;
    }

    .category-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .cat-card {
        padding: 0.75rem 0.35rem;
    }

    .cat-icon {
        font-size: 1.5rem;
        margin-bottom: 0.15rem;
    }

    .cat-name {
        font-size: 0.82rem;
    }

    .cat-desc {
        font-size: 0.68rem;
    }

    .nav-btn {
        font-size: 0.76rem;
        padding: 0.4rem 0.45rem;
    }
}

/* STREAK MODAL OVERLAY & CARD */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    position: relative;
    max-width: 460px;
    width: 100%;
    text-align: center;
    padding: 2.25rem 1.75rem;
    border-radius: 20px;
    border: 1px solid var(--accent-gold);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.modal-close-btn:hover {
    color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.1);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--accent-gold-bright);
    margin-bottom: 0.75rem;
}

.streak-highlight-text {
    font-size: 1.15rem;
    color: #f8fafc;
    margin-bottom: 0.75rem;
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.modal-verse {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--accent-gold);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: left;
}

/* 10-QUIZ PICKER GRID (Ticket 1) */
.quiz-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.85rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .quiz-picker-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }
}

.quiz-pill-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 0.85rem 0.6rem;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.quiz-pill-btn:hover {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.25);
}

.quiz-pill-btn .quiz-pill-num {
    font-size: 1.05rem;
    color: var(--accent-gold-bright);
}

.quiz-pill-btn .quiz-pill-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 400;
}
