/* ==========================================================================
   Ruwe Holy Ghost Church of East Africa
   Dho-Roho Translator: Translation Map & Learn Dho-Roho Stylesheet
   Theme: Black, White, Red (#dc143c), Gradients & Sleek Glassmorphism
   Mobile-First & Ultra-Responsive
   ========================================================================== */

:root {
    --roho-red: #dc143c;
    --roho-red-dark: #a10d2c;
    --roho-red-light: #ff476f;
    --roho-red-subtle: rgba(220, 20, 60, 0.08);
    --roho-red-glow: rgba(220, 20, 60, 0.35);
    
    --roho-black: #0b0c10;
    --roho-dark: #16181e;
    --roho-dark-card: #1f222b;
    --roho-gray-dark: #2a2e39;
    --roho-gray-mid: #6b7280;
    --roho-gray-light: #e5e7eb;
    --roho-bg-light: #f8f9fa;
    --roho-white: #ffffff;
    
    --roho-gradient-hero: linear-gradient(to bottom left, var(--color-red, #dc143c) 0%, var(--color-black, #000000) 100%);
    --roho-gradient-red: linear-gradient(135deg, #dc143c 0%, #900c25 100%);
    --roho-gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    --roho-gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    --roho-radius-sm: 8px;
    --roho-radius-md: 14px;
    --roho-radius-lg: 20px;
    --roho-radius-pill: 9999px;

    --roho-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --roho-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --roho-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.16);
    --roho-shadow-red: 0 8px 25px rgba(220, 20, 60, 0.3);
}

/* ==========================================================================
   Hero Section & Navigation Buttons (Integrated into Translator Hero)
   ========================================================================== */

.hero-actions-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.hero-feature-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.6rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: var(--roho-radius-pill);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.hero-feature-btn-map {
    background: rgba(255, 255, 255, 0.12);
    color: var(--roho-white) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.hero-feature-btn-map:hover {
    background: var(--roho-white);
    color: var(--roho-black) !important;
    border-color: var(--roho-white);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.25);
}

.hero-feature-btn-map:hover i {
    color: var(--roho-red);
}

.hero-feature-btn-learn {
    background: var(--roho-gradient-red);
    color: var(--roho-white) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--roho-shadow-red);
}

.hero-feature-btn-learn:hover {
    background: linear-gradient(135deg, #ff2a55 0%, #b01030 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(220, 20, 60, 0.5);
    color: var(--roho-white) !important;
}

.hero-feature-btn .btn-badge {
    background: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--roho-radius-pill);
    margin-left: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Page Header & Breadcrumbs
   ========================================================================== */

.roho-page-header {
    background: linear-gradient(to bottom left, var(--color-red, #dc143c) 0%, var(--color-black, #000000) 100%) !important;
    color: var(--roho-white);
    padding: 3.5rem 1rem 3rem;
    position: relative;
    border-bottom: 3px solid var(--roho-red);
    overflow: hidden;
}

.roho-page-header::after {
    display: none !important;
}

.roho-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.roho-breadcrumbs a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.roho-breadcrumbs a:hover {
    color: var(--roho-red-light);
}

.roho-breadcrumbs .sep {
    color: rgba(255, 255, 255, 0.4);
}

.roho-breadcrumbs .current {
    color: var(--roho-white);
    font-weight: 600;
}

.roho-page-title {
    font-family: var(--font-secondary, 'Lora', serif);
    font-size: 2.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.roho-page-title i {
    color: var(--roho-red-light);
    margin-right: 0.5rem;
}

.roho-page-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 800px;
    line-height: 1.6;
}

/* Header Quick Stats Bar */
.roho-stats-strip {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.5rem 1rem;
    border-radius: var(--roho-radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
}

.stat-chip i {
    color: var(--roho-red-light);
}

.stat-chip strong {
    color: var(--roho-white);
}

/* ==========================================================================
   2-Step Linguistic Bridge Infographic (English/Swahili -> Luo -> Roho)
   ========================================================================== */

.linguistic-bridge-card {
    background: linear-gradient(135deg, #11141a 0%, #1c1417 100%);
    border: 1px solid rgba(220, 20, 60, 0.3);
    border-radius: var(--roho-radius-md);
    padding: 1.75rem;
    color: var(--roho-white);
    margin-bottom: 2.5rem;
    box-shadow: var(--roho-shadow-md);
}

.linguistic-bridge-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.linguistic-bridge-header h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--roho-white);
    margin: 0;
}

.linguistic-bridge-header span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.bridge-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1.2fr;
    align-items: center;
    gap: 0.75rem;
}

.bridge-step {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--roho-radius-sm);
    padding: 1rem;
    text-align: center;
    position: relative;
}

.bridge-step.step-luo {
    border-color: rgba(220, 20, 60, 0.5);
    background: rgba(220, 20, 60, 0.08);
}

.bridge-step.step-roho {
    border-color: var(--roho-red);
    background: var(--roho-gradient-red);
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4);
}

.bridge-step .step-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.bridge-step.step-roho .step-label {
    color: rgba(255, 255, 255, 0.9);
}

.bridge-step .step-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--roho-white);
}

.bridge-step .step-example {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.35rem;
    font-style: italic;
}

.bridge-arrow {
    color: var(--roho-red-light);
    font-size: 1.35rem;
    text-align: center;
}

@media (max-width: 768px) {
    .bridge-flow {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .bridge-arrow {
        transform: rotate(90deg);
        padding: 0.2rem 0;
    }
}

/* ==========================================================================
   Interactive Syllable Explorer & Live Rule Tester
   ========================================================================== */

.interactive-explorer-card {
    background: #ffffff;
    border-radius: var(--roho-radius-md);
    box-shadow: var(--roho-shadow-md);
    border: 1px solid var(--roho-gray-light);
    padding: 1.75rem;
    margin-bottom: 2.5rem;
}

.explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.explorer-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--roho-black);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.explorer-header h3 i {
    color: var(--roho-red);
}

.explorer-input-wrapper {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.explorer-input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    font-size: 1.15rem;
    border: 2px solid var(--roho-gray-light);
    border-radius: var(--roho-radius-sm);
    font-family: inherit;
    transition: all 0.25s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.explorer-input:focus {
    outline: none;
    border-color: var(--roho-red);
    box-shadow: 0 0 0 4px var(--roho-red-subtle);
}

.explorer-result-box {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: var(--roho-radius-sm);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.explorer-result-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.explorer-item-badge {
    display: flex;
    flex-direction: column;
}

.explorer-item-badge .badge-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--roho-gray-mid);
    font-weight: 600;
}

.explorer-item-badge .badge-val {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.explorer-item-badge .badge-val.val-luo {
    color: var(--roho-black);
}

.explorer-item-badge .badge-val.val-roho {
    color: var(--roho-red);
}

.explorer-arrow-icon {
    font-size: 1.5rem;
    color: var(--roho-red);
}

.explorer-rule-meta {
    font-size: 0.85rem;
    background: #ffffff;
    border: 1px solid #d5d5d5;
    padding: 0.4rem 0.8rem;
    border-radius: var(--roho-radius-pill);
    color: var(--roho-dark);
}

.quick-pills-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.quick-pills-bar span {
    font-size: 0.8rem;
    color: var(--roho-gray-mid);
    font-weight: 600;
}

.quick-pill-btn {
    background: #f0f2f5;
    border: 1px solid #e0e3e8;
    color: var(--roho-black);
    padding: 0.3rem 0.65rem;
    border-radius: var(--roho-radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-pill-btn:hover {
    background: var(--roho-red);
    color: var(--roho-white);
    border-color: var(--roho-red);
}

/* ==========================================================================
   Navigation Tabs / Category Switchers
   ========================================================================== */

.roho-tabs-nav {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--roho-gray-light);
    scrollbar-width: thin;
}

.roho-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-radius: var(--roho-radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--roho-dark);
    background: transparent;
    border: 1.5px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.roho-tab-btn:hover {
    background: #f1f3f5;
    color: var(--roho-black);
}

.roho-tab-btn.active {
    background: var(--roho-black);
    color: var(--roho-white);
    border-color: var(--roho-black);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.roho-tab-btn.active.tab-accent-red {
    background: var(--roho-red);
    border-color: var(--roho-red);
    box-shadow: var(--roho-shadow-red);
}

.roho-tab-badge {
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--roho-radius-pill);
}

.roho-tab-btn:not(.active) .roho-tab-badge {
    background: #e2e8f0;
    color: var(--roho-dark);
}

/* Search & View Controls Bar */
.filter-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-input-box {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.search-input-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--roho-gray-mid);
    font-size: 0.95rem;
}

.search-input-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--roho-gray-light);
    border-radius: var(--roho-radius-pill);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #ffffff;
}

.search-input-box input:focus {
    outline: none;
    border-color: var(--roho-red);
    box-shadow: 0 0 0 3px var(--roho-red-subtle);
}

.view-toggle-group {
    display: inline-flex;
    background: #f0f2f5;
    padding: 0.25rem;
    border-radius: var(--roho-radius-pill);
    border: 1px solid #e0e3e8;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--roho-gray-mid);
    border-radius: var(--roho-radius-pill);
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle-btn.active {
    background: var(--roho-white);
    color: var(--roho-red);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Vowels Holy Rotation Matrix
   ========================================================================== */

.vowels-circular-container {
    background: linear-gradient(135deg, #0b0c10 0%, #1e1317 100%);
    border: 1px solid rgba(220, 20, 60, 0.4);
    border-radius: var(--roho-radius-md);
    padding: 2.25rem;
    color: var(--roho-white);
    margin-bottom: 2.5rem;
    box-shadow: var(--roho-shadow-lg);
    position: relative;
    overflow: hidden;
}

.vowels-circular-container::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 45%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(220, 20, 60, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.vowels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.vowel-cycle-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--roho-radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.vowel-cycle-card:hover {
    transform: translateY(-5px);
    background: rgba(220, 20, 60, 0.12);
    border-color: var(--roho-red);
    box-shadow: 0 10px 25px rgba(220, 20, 60, 0.3);
}

.vowel-pair {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.vowel-letter {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
}

.vowel-letter.luo {
    color: var(--roho-white);
}

.vowel-letter.roho {
    color: var(--roho-red-light);
}

.vowel-arrow {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

.vowel-phonetic {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.vowel-audio-btn {
    background: rgba(255, 255, 255, 0.12);
    color: var(--roho-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.8rem;
    border-radius: var(--roho-radius-pill);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.vowel-audio-btn:hover {
    background: var(--roho-red);
    border-color: var(--roho-red);
}

/* ==========================================================================
   Modern Rules Card Grid
   ========================================================================== */

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.rule-card {
    background: #ffffff;
    border: 1px solid var(--roho-gray-light);
    border-radius: var(--roho-radius-md);
    padding: 1.25rem;
    transition: all 0.25s ease;
    box-shadow: var(--roho-shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.rule-card:hover {
    border-color: var(--roho-red);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.rule-card-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: var(--roho-radius-pill);
    background: #f3f4f6;
    color: var(--roho-dark);
}

.rule-card-badge.priority-high {
    background: #fee2e2;
    color: #991b1b;
}

.rule-card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.rule-char-box {
    display: flex;
    flex-direction: column;
}

.rule-char-box .char-label {
    font-size: 0.7rem;
    color: var(--roho-gray-mid);
    text-transform: uppercase;
    font-weight: 600;
}

.rule-char-box .char-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.rule-char-box .char-value.luo {
    color: var(--roho-black);
}

.rule-char-box .char-value.roho {
    color: var(--roho-red);
}

.rule-card-arrow {
    color: var(--roho-red);
    font-size: 1.1rem;
}

.rule-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.rule-action-btn {
    background: none;
    border: none;
    color: var(--roho-gray-mid);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.rule-action-btn:hover {
    color: var(--roho-red);
    background: #fdf2f4;
}

/* ==========================================================================
   Dense Modern Table View
   ========================================================================== */

.roho-table-container {
    background: #ffffff;
    border-radius: var(--roho-radius-md);
    box-shadow: var(--roho-shadow-sm);
    border: 1px solid var(--roho-gray-light);
    overflow-x: auto;
    margin-bottom: 2.5rem;
}

.roho-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.roho-table th {
    background: #f8fafc;
    color: var(--roho-black);
    font-weight: 700;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--roho-gray-light);
    white-space: nowrap;
}

.roho-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

.roho-table tbody tr:hover {
    background: #fff8f9;
}

.roho-table .col-thumb {
    width: 60px;
}

.roho-table .thumb-img {
    width: 48px;
    height: 48px;
    border-radius: var(--roho-radius-sm);
    object-fit: cover;
    box-shadow: var(--roho-shadow-sm);
}

.roho-table .lang-luo {
    font-weight: 600;
    color: var(--roho-dark);
}

.roho-table .lang-roho {
    font-weight: 700;
    color: var(--roho-red);
    font-size: 1.05rem;
}

.roho-table .badge-roho {
    display: inline-block;
    background: #fff0f3;
    color: var(--roho-red);
    border: 1px solid #fecdd3;
    padding: 0.25rem 0.65rem;
    border-radius: var(--roho-radius-pill);
    font-weight: 700;
}

/* Audio Pronunciation Button */
.btn-pronounce {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--roho-dark);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.btn-pronounce:hover {
    background: var(--roho-red);
    color: var(--roho-white);
    border-color: var(--roho-red);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(220, 20, 60, 0.3);
}

.btn-pronounce.speaking {
    background: var(--roho-red);
    color: var(--roho-white);
    animation: pulse-audio 1.2s infinite ease-in-out;
}

@keyframes pulse-audio {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 20, 60, 0.6); }
    70% { transform: scale(1.12); box-shadow: 0 0 0 10px rgba(220, 20, 60, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 20, 60, 0); }
}

/* ==========================================================================
   Learn Dho-Roho Hub: Categories Grid
   ========================================================================== */

.category-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
    margin-bottom: 3.5rem;
}

.learning-category-card {
    background: #ffffff;
    border-radius: var(--roho-radius-md);
    overflow: hidden;
    border: 1px solid var(--roho-gray-light);
    box-shadow: var(--roho-shadow-sm);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.learning-category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--roho-shadow-lg);
    border-color: rgba(220, 20, 60, 0.4);
}

.category-card-media {
    height: 180px;
    position: relative;
    overflow: hidden;
    background: var(--roho-dark);
}

.category-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.learning-category-card:hover .category-card-media img {
    transform: scale(1.08);
}

.category-card-media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(11, 12, 16, 0.85) 100%);
}

.category-badge-icon {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--roho-gradient-red);
    color: var(--roho-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.category-count-badge {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: var(--roho-white);
    backdrop-filter: blur(8px);
    padding: 0.3rem 0.75rem;
    border-radius: var(--roho-radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.category-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.category-card-title {
    font-family: var(--font-secondary, 'Lora', serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--roho-black);
    margin-bottom: 0.25rem;
}

.category-card-luo-title {
    font-size: 0.95rem;
    color: var(--roho-red);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.category-card-desc {
    font-size: 0.9rem;
    color: var(--roho-gray-mid);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex: 1;
}

.category-card-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: auto;
}

.btn-module-main {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--roho-black);
    color: var(--roho-white) !important;
    border-radius: var(--roho-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-module-main:hover {
    background: var(--roho-red);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.btn-module-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.85rem;
    background: #f3f4f6;
    color: var(--roho-dark) !important;
    border-radius: var(--roho-radius-sm);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-module-secondary:hover {
    background: #e5e7eb;
    color: var(--roho-black) !important;
}

/* ==========================================================================
   Category Detail: Vocabulary Cards Grid
   ========================================================================== */

.vocab-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.vocab-card {
    background: #ffffff;
    border-radius: var(--roho-radius-md);
    border: 1px solid var(--roho-gray-light);
    box-shadow: var(--roho-shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.vocab-card:hover {
    border-color: rgba(220, 20, 60, 0.4);
    transform: translateY(-4px);
    box-shadow: var(--roho-shadow-md);
}

.vocab-card-img-wrap {
    height: 160px;
    position: relative;
    overflow: hidden;
    background: #f1f3f5;
}

.vocab-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.vocab-card:hover .vocab-card-img-wrap img {
    transform: scale(1.06);
}

.vocab-card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vocab-lang-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.vocab-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.88rem;
}

.vocab-row .row-label {
    color: var(--roho-gray-mid);
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 600;
}

.vocab-row .row-val {
    font-weight: 600;
    color: var(--roho-dark);
}

.vocab-row.row-roho .row-val {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--roho-red);
}

.vocab-row.row-luo .row-val {
    font-weight: 700;
    color: var(--roho-black);
}

.vocab-phonetic-badge {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--roho-radius-sm);
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    color: var(--roho-gray-mid);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.vocab-card-desc {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.vocab-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f3f5;
}

/* ==========================================================================
   Interactive 3D Flashcards Mode
   ========================================================================== */

.flashcard-mode-container {
    max-width: 640px;
    margin: 0 auto 3rem;
}

.flashcard-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.flashcard-counter {
    font-size: 1rem;
    font-weight: 700;
    color: var(--roho-dark);
}

.flashcard-stage {
    perspective: 1200px;
    margin-bottom: 1.75rem;
}

.flashcard-card {
    min-height: 380px;
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: var(--roho-radius-lg);
    box-shadow: var(--roho-shadow-lg);
}

.flashcard-card.flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--roho-radius-lg);
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.flashcard-front {
    background: #ffffff;
    border: 2px solid var(--roho-gray-light);
}

.flashcard-back {
    background: linear-gradient(135deg, #101217 0%, #1f0f15 100%);
    color: var(--roho-white);
    border: 2px solid var(--roho-red);
    transform: rotateY(180deg);
}

.flashcard-face .card-hint-text {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--roho-gray-mid);
}

.flashcard-back .card-hint-text {
    color: rgba(255, 255, 255, 0.6);
}

.flashcard-image-wrap {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin: 1rem auto;
    border: 3px solid var(--roho-gray-light);
    box-shadow: var(--roho-shadow-sm);
}

.flashcard-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flashcard-main-title {
    font-family: var(--font-secondary, 'Lora', serif);
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.flashcard-front .flashcard-main-title {
    color: var(--roho-black);
}

.flashcard-back .flashcard-main-title {
    color: var(--roho-red-light);
}

.flashcard-sub-info {
    font-size: 1.1rem;
    color: var(--roho-gray-mid);
}

.flashcard-back .flashcard-sub-info {
    color: rgba(255, 255, 255, 0.85);
}

.flashcard-action-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.btn-nav-card {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    background: #ffffff;
    border: 1px solid var(--roho-gray-light);
    border-radius: var(--roho-radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--roho-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav-card:hover {
    background: var(--roho-black);
    color: var(--roho-white);
    border-color: var(--roho-black);
}

.btn-flip-card {
    background: var(--roho-gradient-red);
    color: var(--roho-white);
    border: none;
    box-shadow: var(--roho-shadow-red);
}

.btn-flip-card:hover {
    background: #b01030;
    transform: translateY(-2px);
}

/* ==========================================================================
   Practice Quiz Mode
   ========================================================================== */

.quiz-mode-container {
    max-width: 680px;
    margin: 0 auto 3.5rem;
}

.quiz-box {
    background: #ffffff;
    border-radius: var(--roho-radius-md);
    box-shadow: var(--roho-shadow-md);
    border: 1px solid var(--roho-gray-light);
    padding: 2.25rem;
    position: relative;
    overflow: hidden;
}

.quiz-progress-bar-wrap {
    height: 6px;
    background: #f1f3f5;
    border-radius: var(--roho-radius-pill);
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: var(--roho-gradient-red);
    transition: width 0.3s ease;
}

.quiz-question-counter {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--roho-red);
    margin-bottom: 0.5rem;
}

.quiz-question-title {
    font-family: var(--font-secondary, 'Lora', serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--roho-black);
    margin-bottom: 1.5rem;
    line-height: 1.35;
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.quiz-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--roho-radius-sm);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--roho-dark);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-option-btn:hover:not(.disabled) {
    background: #ffffff;
    border-color: var(--roho-red);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.1);
    transform: translateX(4px);
}

.quiz-option-btn.correct {
    background: #f0fdf4 !important;
    border-color: #22c55e !important;
    color: #15803d !important;
}

.quiz-option-btn.incorrect {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
}

.quiz-feedback-box {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--roho-radius-sm);
    font-size: 0.95rem;
    display: none;
}

.quiz-feedback-box.correct {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.quiz-feedback-box.incorrect {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Quiz Completion Card */
.quiz-complete-card {
    text-align: center;
    padding: 2rem 1rem;
}

.quiz-complete-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--roho-gradient-red);
    color: var(--roho-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    box-shadow: var(--roho-shadow-red);
}

.quiz-score-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--roho-black);
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Detail Modal Styles
   ========================================================================== */

.roho-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.roho-modal-backdrop.active {
    display: flex;
}

.roho-modal-card {
    background: #ffffff;
    border-radius: var(--roho-radius-md);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: var(--roho-white);
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: var(--roho-red);
}

.modal-media-cover {
    height: 220px;
    width: 100%;
    background: var(--roho-black);
    position: relative;
}

.modal-media-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-content-body {
    padding: 1.75rem;
}

/* ==========================================================================
   Audio Pronunciation Button & Pulse Wave Animation
   ========================================================================== */
.btn-pronounce {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--roho-red);
    border: 1.5px solid var(--roho-red);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(220, 20, 60, 0.15);
    flex-shrink: 0;
    position: relative;
    user-select: none;
}

.btn-pronounce:hover {
    background: var(--roho-red);
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(220, 20, 60, 0.35);
}

.btn-pronounce:active {
    transform: scale(0.95);
}

.btn-pronounce-sm {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.btn-pronounce.speaking,
.btn.speaking,
.vowel-audio-btn.speaking {
    background: var(--roho-red) !important;
    color: #ffffff !important;
    border-color: var(--roho-red) !important;
    animation: rohoPulseAudio 1.1s infinite ease-in-out;
}

@keyframes rohoPulseAudio {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 20, 60, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 20, 60, 0);
        transform: scale(1.06);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 20, 60, 0);
        transform: scale(1);
    }
}

/* ==========================================================================
   Component Base Helpers (Portal Search, Spotlight, Nav & Methodology)
   ========================================================================== */

.portal-search-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: var(--roho-radius-md);
    box-shadow: var(--roho-shadow-sm);
    border: 1px solid var(--roho-gray-light);
    margin-bottom: 2.5rem;
    position: relative;
}

.portal-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portal-search-header label {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--roho-black);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-search-sub {
    font-size: 0.85rem;
    color: var(--roho-gray-mid);
}

/* Spotlight Card Base */
.roho-spotlight-card {
    background: linear-gradient(135deg, #0b0c10 0%, #1a1015 100%);
    border: 1px solid rgba(220, 20, 60, 0.4);
    border-radius: var(--roho-radius-md);
    padding: 2rem;
    color: var(--roho-white);
    margin-bottom: 3rem;
    box-shadow: var(--roho-shadow-md);
    position: relative;
    overflow: hidden;
}

.spotlight-watermark {
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 8rem;
    color: rgba(220, 20, 60, 0.05);
    font-weight: 900;
    pointer-events: none;
    user-select: none;
}

.spotlight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.spotlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--roho-gradient-red);
    padding: 0.3rem 0.8rem;
    border-radius: var(--roho-radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.spotlight-source {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.spotlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: center;
}

.spotlight-col {
    display: flex;
    flex-direction: column;
}

.spotlight-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.spotlight-label-roho {
    color: var(--roho-red-light);
    font-weight: 700;
}

.spotlight-val {
    font-weight: 700;
    line-height: 1.2;
    margin: 0.2rem 0;
}

.spotlight-val-eng {
    font-size: 1.4rem;
}

.spotlight-val-luo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--roho-white);
}

.spotlight-val-roho {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--roho-red-light);
}

.spotlight-sub {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.spotlight-action {
    text-align: right;
}

.btn-spotlight-audio {
    border-radius: var(--roho-radius-pill);
    font-size: 0.95rem;
    padding: 0.65rem 1.4rem;
}

/* Methodology Section */
.roho-methodology-card {
    background: #ffffff;
    border-radius: var(--roho-radius-md);
    border: 1px solid var(--roho-gray-light);
    padding: 2.5rem 2rem;
    box-shadow: var(--roho-shadow-sm);
    margin-bottom: 3.5rem;
}

.methodology-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.methodology-kicker {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--roho-red);
    letter-spacing: 0.05em;
}

.methodology-title {
    font-family: var(--font-secondary, 'Lora', serif);
    font-size: 1.8rem;
    color: var(--roho-black);
    margin-top: 0.35rem;
}

.methodology-desc {
    color: var(--roho-gray-mid);
    font-size: 0.95rem;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.75rem;
}

/* Category Detail Header & Nav */
.category-header-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.category-header-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--roho-gradient-red);
    color: var(--roho-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4);
    flex-shrink: 0;
}

.category-header-text {
    flex: 1;
    min-width: 200px;
}

.category-title-heading {
    margin: 0;
    font-size: 2.2rem;
}

.category-title-luo {
    color: var(--roho-red-light);
    font-size: 1.15rem;
    font-weight: 600;
}

.category-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-nav-left {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.category-nav-right {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-nav-sub {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

/* Explorer Actions */
.explorer-result-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Matrix Section Headers */
.matrix-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.75rem 0 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Modal Linguistic Pathway Box */
.modal-pathway-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-around;
    text-align: center;
    gap: 0.5rem;
}

/* Table Horizontal Scroll Indicator Container */
.roho-table-container {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.roho-table-container::-webkit-scrollbar {
    height: 6px;
}

.roho-table-container::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.roho-table-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.roho-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--roho-red);
}


/* ==========================================================================
   COMPREHENSIVE ULTRA-RESPONSIVE SYSTEM (Mobile & Tablet Breakpoints)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tablet & Medium Devices (max-width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .category-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }

    .vocab-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.25rem;
    }

    .rules-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.85rem;
    }

    .vowels-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
}

/* --------------------------------------------------------------------------
   Tablets & Phablets (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Header & Page Title */
    .roho-page-header {
        padding: 2.5rem 1rem 2rem;
    }

    .roho-page-title {
        font-size: 1.85rem;
    }

    .roho-page-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }

    .roho-stats-strip {
        gap: 0.6rem;
        padding-top: 1.2rem;
        margin-top: 1.2rem;
    }

    .stat-chip {
        padding: 0.4rem 0.85rem;
        font-size: 0.82rem;
    }

    /* Hero Buttons */
    .hero-actions-container {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
        margin-top: 1.25rem;
    }

    .hero-feature-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* Category Navigation */
    .category-nav-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
    }

    .category-nav-left,
    .category-nav-right {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }

    .btn-nav-sub {
        flex: 1;
        justify-content: center;
        font-size: 0.85rem;
        padding: 0.55rem 0.8rem;
    }

    /* Linguistic Bridge */
    .linguistic-bridge-card {
        padding: 1.25rem 1rem;
        margin-bottom: 1.75rem;
    }

    .bridge-flow {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .bridge-arrow {
        transform: rotate(90deg);
        padding: 0.2rem 0;
        font-size: 1.1rem;
    }

    /* Tabs Bar */
    .roho-tabs-nav {
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        margin-bottom: 1.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .roho-tab-btn {
        padding: 0.65rem 1.1rem;
        font-size: 0.88rem;
        flex-shrink: 0;
    }

    /* Filter & View Controls Bar */
    .filter-controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .search-input-box {
        max-width: 100%;
        width: 100%;
    }

    .view-toggle-group {
        width: 100%;
        display: flex;
    }

    .view-toggle-btn {
        flex: 1;
        justify-content: center;
        padding: 0.55rem;
    }

    /* Spotlight Card */
    .roho-spotlight-card {
        padding: 1.5rem 1.25rem;
        margin-bottom: 2rem;
    }

    .spotlight-watermark {
        font-size: 5rem;
        top: -10px;
        right: -10px;
    }

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

    .spotlight-action {
        grid-column: span 2;
        text-align: center;
        margin-top: 0.5rem;
    }

    .btn-spotlight-audio {
        width: 100%;
        justify-content: center;
    }

    /* Methodology Section */
    .roho-methodology-card {
        padding: 1.75rem 1.25rem;
        margin-bottom: 2.5rem;
    }

    .methodology-header {
        margin-bottom: 1.75rem;
    }

    .methodology-title {
        font-size: 1.45rem;
    }

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

    /* Tables */
    .roho-table {
        min-width: 620px;
    }
}

/* --------------------------------------------------------------------------
   Mobile Phones & Compact Devices (max-width: 576px)
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
    /* Header */
    .roho-page-header {
        padding: 2rem 0.85rem 1.5rem;
    }

    .roho-breadcrumbs {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        gap: 0.35rem;
    }

    .roho-page-title {
        font-size: 1.55rem;
        line-height: 1.3;
    }

    .category-header-title-row {
        gap: 0.75rem;
    }

    .category-header-icon-box {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .category-title-heading {
        font-size: 1.6rem !important;
    }

    .category-title-luo {
        font-size: 1rem !important;
    }

    .roho-stats-strip {
        gap: 0.45rem;
    }

    .stat-chip {
        flex: 1 1 calc(50% - 0.45rem);
        justify-content: center;
        font-size: 0.78rem;
        padding: 0.35rem 0.65rem;
        text-align: center;
    }

    /* Section padding */
    .section {
        padding-top: 1.5rem !important;
    }

    /* Portal Vocabulary Finder Search Box */
    .portal-search-card {
        padding: 1rem 0.85rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }

    .portal-search-header label {
        font-size: 0.98rem;
    }

    .portal-search-sub {
        font-size: 0.8rem;
    }

    .portal-search-card input {
        font-size: 16px !important; /* Prevents auto-zoom in mobile Safari */
        padding: 0.75rem 1rem 0.75rem 2.5rem !important;
    }

    /* Spotlight Card */
    .roho-spotlight-card {
        padding: 1.25rem 0.95rem;
        margin-bottom: 1.75rem;
        border-radius: 12px;
    }

    .spotlight-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        text-align: left;
    }

    .spotlight-action {
        grid-column: span 1;
        margin-top: 0.35rem;
    }

    .spotlight-val-eng {
        font-size: 1.25rem;
    }

    .spotlight-val-luo {
        font-size: 1.4rem;
    }

    .spotlight-val-roho {
        font-size: 1.6rem !important;
    }

    /* Category Cards Grid (learn/) */
    .category-cards-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-bottom: 2.5rem;
    }

    .learning-category-card {
        border-radius: 12px;
    }

    .category-card-media {
        height: 155px;
    }

    .category-card-body {
        padding: 1.15rem 1rem;
    }

    .category-card-title {
        font-size: 1.25rem;
    }

    .category-card-luo-title {
        font-size: 0.9rem;
    }

    .category-card-desc {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .category-card-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .btn-module-main {
        width: 100%;
        flex: 1 1 100%;
        padding: 0.65rem;
        font-size: 0.88rem;
    }

    .btn-module-secondary {
        flex: 1;
        padding: 0.55rem;
        font-size: 0.82rem;
    }

    /* Vocabulary Cards Grid (category_detail.html) */
    .vocab-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .vocab-card {
        border-radius: 12px;
    }

    .vocab-card-img-wrap {
        height: 155px;
    }

    .vocab-card-content {
        padding: 1rem 0.85rem;
    }

    .vocab-row {
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .vocab-row .row-label {
        font-size: 0.75rem;
        flex-shrink: 0;
    }

    .vocab-row .row-val {
        text-align: right;
        word-break: break-word;
    }

    .vocab-row.row-roho .row-val {
        font-size: 1.15rem;
    }

    .vocab-phonetic-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .vocab-card-desc {
        font-size: 0.82rem;
        margin-bottom: 0.75rem;
        line-height: 1.45;
    }

    .vocab-card-footer {
        padding-top: 0.65rem;
    }

    .btn-pronounce {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    /* 3D Flashcards Mode */
    .flashcard-mode-container {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .flashcard-controls-top {
        margin-bottom: 1rem;
    }

    .flashcard-counter {
        font-size: 0.9rem;
    }

    .flashcard-stage {
        perspective: 1000px;
        margin-bottom: 1.25rem;
    }

    .flashcard-card {
        min-height: 400px;
        border-radius: 14px;
    }

    .flashcard-face {
        padding: 1.5rem 1rem;
        border-radius: 14px;
    }

    .flashcard-image-wrap {
        width: 110px;
        height: 110px;
        margin: 0.5rem auto;
    }

    .flashcard-main-title {
        font-size: 1.6rem;
    }

    .flashcard-sub-info {
        font-size: 0.95rem;
    }

    #fc-back-luo {
        font-size: 1.4rem !important;
    }

    #fc-back-roho {
        font-size: 1.7rem !important;
    }

    #fc-back-phonetic {
        font-size: 0.88rem !important;
    }

    .flashcard-face .btn {
        font-size: 0.8rem;
        padding: 0.45rem 0.75rem;
    }

    .flashcard-action-bar {
        gap: 0.4rem;
        width: 100%;
    }

    .btn-nav-card {
        padding: 0.65rem 0.6rem;
        font-size: 0.82rem;
        flex: 1;
        justify-content: center;
        gap: 0.3rem;
    }

    .btn-flip-card {
        flex: 1.3;
        font-weight: 700;
    }

    /* Practice Quiz Mode */
    .quiz-mode-container {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .quiz-box {
        padding: 1.25rem 0.9rem;
        border-radius: 12px;
    }

    .quiz-question-counter {
        font-size: 0.8rem;
    }

    .quiz-question-title {
        font-size: 1.18rem;
        line-height: 1.35;
        margin-bottom: 1rem;
    }

    .quiz-options-list {
        gap: 0.6rem;
        margin-bottom: 1.25rem;
    }

    .quiz-option-btn {
        padding: 0.85rem 0.9rem;
        font-size: 0.95rem;
        border-radius: 8px;
        line-height: 1.35;
    }

    #btn-quiz-next {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }

    .quiz-complete-card {
        padding: 1.5rem 1rem;
    }

    .quiz-score-number {
        font-size: 2.4rem;
    }

    .quiz-complete-card button {
        width: 100%;
        justify-content: center;
    }

    /* Word Detail Modal */
    .roho-modal-backdrop {
        padding: 0.5rem;
    }

    .roho-modal-card {
        max-height: 94vh;
        border-radius: 12px;
    }

    .modal-media-cover {
        height: 160px;
    }

    .modal-content-body {
        padding: 1rem 0.85rem;
    }

    #modal-english {
        font-size: 1.3rem !important;
    }

    .modal-pathway-box {
        padding: 0.85rem 0.5rem;
    }

    .modal-content-body .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .matrix-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        margin: 1.25rem 0 0.75rem;
    }

    /* -----------------------------------------------------------------------
       Translation Map (translation-map/) Mobile Optimizations
       ----------------------------------------------------------------------- */
    /* Interactive Syllable Explorer */
    .interactive-explorer-card {
        padding: 1.25rem 0.85rem;
        border-radius: 12px;
        margin-bottom: 1.75rem;
    }

    .explorer-header h3 {
        font-size: 1.15rem;
    }

    .explorer-input-wrapper {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .explorer-input {
        font-size: 1rem;
        padding: 0.7rem 0.85rem;
    }

    .explorer-result-box {
        padding: 1rem 0.75rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .explorer-result-left {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 0.6rem;
    }

    .explorer-result-left > div:not(.explorer-rule-meta) {
        display: inline-flex;
    }

    .explorer-item-badge .badge-val {
        font-size: 1.4rem;
    }

    .explorer-arrow-icon {
        font-size: 1.15rem;
    }

    .explorer-rule-meta {
        font-size: 0.78rem;
        text-align: center;
        width: 100%;
        padding: 0.35rem 0.65rem;
    }

    .explorer-result-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .explorer-result-actions button {
        flex: 1;
        justify-content: center;
        font-size: 0.82rem;
        padding: 0.55rem;
    }

    /* Quick Pills Bar */
    .quick-pills-bar {
        gap: 0.35rem;
        margin-top: 0.75rem;
    }

    .quick-pills-bar span {
        width: 100%;
        margin-bottom: 0.2rem;
    }

    .quick-pill-btn {
        font-size: 0.78rem;
        padding: 0.35rem 0.55rem;
        min-height: 34px;
    }

    /* The 5 Holy Vowels Cycle Card */
    .vowels-circular-container {
        padding: 1.25rem 0.85rem;
        border-radius: 12px;
        margin-bottom: 1.75rem;
    }

    .vowels-circular-container h3 {
        font-size: 1.25rem;
    }

    .vowels-circular-container .btn {
        width: 100%;
        margin-top: 0.65rem;
        justify-content: center;
    }

    .vowels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        margin-top: 1rem;
    }

    .vowel-cycle-card {
        padding: 0.85rem 0.5rem;
    }

    .vowel-cycle-card:nth-child(5) {
        grid-column: span 2;
    }

    .vowel-letter {
        font-size: 1.7rem;
    }

    .vowel-phonetic {
        font-size: 0.78rem;
        margin-bottom: 0.45rem;
    }

    .vowel-audio-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.65rem;
    }

    /* Rules Card Grid */
    .rules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.55rem;
        margin-bottom: 1.75rem;
    }

    .rule-card {
        padding: 0.75rem 0.55rem;
        border-radius: 10px;
    }

    .rule-card-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.35rem;
        top: 0.4rem;
        right: 0.4rem;
    }

    .rule-card-body {
        margin-top: 0.85rem;
        margin-bottom: 0.5rem;
        gap: 0.4rem;
    }

    .rule-char-box .char-label {
        font-size: 0.62rem;
    }

    .rule-char-box .char-value {
        font-size: 1.25rem;
    }

    .rule-card-arrow {
        font-size: 0.85rem;
    }

    .rule-card-actions {
        padding-top: 0.45rem;
    }

    .rule-action-btn {
        font-size: 0.72rem;
        padding: 0.25rem 0.35rem;
    }

    /* Dense Tables in Translation Map */
    .roho-table {
        min-width: 540px;
        font-size: 0.85rem;
    }

    .roho-table th,
    .roho-table td {
        padding: 0.65rem 0.75rem;
    }
}

/* --------------------------------------------------------------------------
   Small Phones (iPhone SE, Galaxy A, max-width: 380px)
   -------------------------------------------------------------------------- */
@media (max-width: 380px) {
    .stat-chip {
        flex: 1 1 100%;
    }

    .category-title-heading {
        font-size: 1.4rem !important;
    }

    .rules-grid {
        grid-template-columns: 1fr;
    }

    .rule-card-body {
        gap: 1rem;
    }

    .rule-char-box .char-value {
        font-size: 1.4rem;
    }

    .vowels-grid {
        grid-template-columns: 1fr;
    }

    .vowel-cycle-card:nth-child(5) {
        grid-column: span 1;
    }

    .flashcard-card {
        min-height: 420px;
    }

    .btn-nav-card {
        font-size: 0.78rem;
        padding: 0.55rem 0.4rem;
    }

    .modal-pathway-box {
        padding: 0.65rem 0.35rem;
        gap: 0.35rem;
    }

    #modal-luo {
        font-size: 1.05rem !important;
    }

    #modal-roho {
        font-size: 1.15rem !important;
    }
}
