@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700&display=swap');

:root {
    --theme-gold: #d9aa42;
    --theme-gold-light: #f1d58b;
    --theme-gold-pale: #fff4d6;
    --theme-maroon: #c52b42;
    --theme-maroon-dark: #74172b;
    --theme-orange: #df7544;
    --theme-navy: #120e18;
    --theme-navy-soft: #21151f;
    --theme-navy-card: #30202b;
    --theme-surface: #30202b;
    --theme-text: #fff7e8;
    --theme-muted: #d6bdc7;
    --theme-border: rgba(217, 170, 66, 0.3);
    --theme-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
    --bs-primary: #c52b42;
    --bs-primary-rgb: 197, 43, 66;
    --bs-warning: #d9aa42;
    --bs-warning-rgb: 217, 170, 66;
    --bs-link-color: #c52b42;
    --bs-link-hover-color: #74172b;
    color-scheme: light;
}

* {
    font-family: 'Raleway', sans-serif;
}

html body {
    background: var(--theme-navy);
    color: var(--theme-text);
    padding-bottom: 82px;
}

html body .mobile-viewport {
    background:
        radial-gradient(circle at 86% 7%, rgba(197, 43, 66, 0.24), transparent 30%),
        radial-gradient(circle at 8% 48%, rgba(217, 170, 66, 0.08), transparent 28%),
        linear-gradient(180deg, #120e18 0%, #1d121c 52%, #120e18 100%);
}

/* ---------- Top header: dark maroon glass with gold accents ---------- */
html body .navbar {
    height: 56px;
    padding: 0;
    background:
        radial-gradient(circle at 50% -40%, rgba(217, 170, 66, 0.22), transparent 60%),
        linear-gradient(180deg, rgba(58, 20, 36, 0.96) 0%, rgba(28, 14, 24, 0.94) 100%) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

html body .navbar.fixed-top::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--theme-gold) 25%, var(--theme-gold-light) 50%, var(--theme-gold) 75%, transparent);
    opacity: 0.85;
}

html body .navbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 100%;
    padding: 0 10px;
}

html body .navbar-brand {
    flex-grow: 1;
    margin: 0;
    padding: 0 8px;
    font-family: 'OpenSans-ExtraBold', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(180deg, var(--theme-gold-pale) 0%, var(--theme-gold-light) 45%, var(--theme-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 6px rgba(217, 170, 66, 0.35));
}

html body .navbar-brand::before,
html body .navbar-brand::after {
    content: "\2726";
    display: inline-block;
    margin: 0 8px;
    font-size: 10px;
    vertical-align: middle;
    -webkit-text-fill-color: var(--theme-gold);
    opacity: 0.8;
}

html body .nav-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    color: var(--theme-gold-light);
    background: rgba(217, 170, 66, 0.08);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

html body .nav-button:hover {
    background: rgba(217, 170, 66, 0.16);
    border-color: rgba(217, 170, 66, 0.6);
    box-shadow: 0 0 12px rgba(217, 170, 66, 0.25);
}

html body .nav-button:active {
    transform: scale(0.94);
}

html body .navbar-right-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

html body .navbar-right-buttons .nav-button {
    margin-right: 0 !important;
}

html body #react-language-selector {
    display: inline-flex;
    align-items: center;
}

/* ---------- Bottom navigation ---------- */
html body .btm-nav {
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background:
        linear-gradient(180deg, rgba(40, 16, 28, 0.94) 0%, rgba(18, 12, 20, 0.98) 100%) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
}

html body .btm-nav::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--theme-gold) 25%, var(--theme-gold-light) 50%, var(--theme-gold) 75%, transparent);
    opacity: 0.7;
}

html body .btm-nav .container-fluid {
    flex-wrap: nowrap;
    gap: 2px;
    padding: 0 4px;
}

html body .btm-nav .nav-link {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    color: var(--theme-muted) !important;
    border-radius: 14px;
    transition: color 0.2s ease, background 0.2s ease;
}

html body .btm-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    color: var(--theme-muted);
    font-size: 17px;
    border-radius: 999px;
    transition: all 0.25s ease;
}

html body .btm-nav .nav-link:hover .btm-nav-icon {
    color: var(--theme-gold-light);
}

html body .btm-nav .nav-link.is-active .btm-nav-icon {
    width: 48px;
    color: #fff;
    background: linear-gradient(135deg, var(--theme-maroon), var(--theme-maroon-dark));
    box-shadow: 0 4px 14px rgba(197, 43, 66, 0.45), inset 0 0 0 1px rgba(241, 213, 139, 0.45);
}

html body .btm-nav .nav-link.is-active .btm-nav-title {
    color: var(--theme-gold-light) !important;
}

html body .btm-nav-title {
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Sidebar (offcanvas) ---------- */
html body .offcanvas-start-custom {
    width: 85% !important;
    max-width: 320px !important;
    color: var(--theme-text);
    background:
        radial-gradient(circle at 100% 0%, rgba(197, 43, 66, 0.18), transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(217, 170, 66, 0.08), transparent 40%),
        linear-gradient(180deg, #24121d 0%, var(--theme-navy) 100%) !important;
    border: 0 !important;
    border-right: 1px solid var(--theme-border) !important;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55) !important;
}

html body .offcanvas-header-custom {
    position: relative;
    padding: 8px 18px;
    background:
        radial-gradient(circle at 15% 0%, rgba(217, 170, 66, 0.22), transparent 55%),
        linear-gradient(145deg, #4a1528 0%, #2a1220 60%, #1d0f19 100%) !important;
    border-bottom: 0 !important;
}

html body .offcanvas-header-custom::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--theme-gold) 30%, var(--theme-gold-light) 50%, var(--theme-gold) 70%, transparent);
    opacity: 0.8;
}

html body .offcanvas-header-custom .text-dark {
    color: var(--theme-gold-pale) !important;
}

html body .offcanvas-header-custom .text-muted {
    color: var(--theme-muted) !important;
    font-size: 12px;
    letter-spacing: 0.3px;
}

html body .user-avatar-placeholder,
html body .app-logo-circle {
    color: var(--theme-maroon-dark) !important;
    background: linear-gradient(135deg, var(--theme-gold-pale), var(--theme-gold-light) 55%, var(--theme-gold)) !important;
    border: 2px solid rgba(255, 244, 214, 0.6) !important;
    box-shadow: 0 0 0 4px rgba(217, 170, 66, 0.15), 0 6px 18px rgba(0, 0, 0, 0.4) !important;
    font-weight: 800;
}

html body .offcanvas-close-btn {
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    opacity: 1;
    background-color: rgba(217, 170, 66, 0.1);
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    filter: invert(86%) sepia(35%) saturate(500%) hue-rotate(350deg);
    background-size: 12px;
}

html body .offcanvas-close-btn:hover {
    background-color: rgba(217, 170, 66, 0.2);
}

html body .sidebar-menu-item {
    padding: 0 12px;
}

html body .sidebar-menu-item a {
    position: relative;
    margin: 2px 0;
    color: #eadfe3;
    border-radius: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

html body .sidebar-menu-item a:hover {
    color: var(--theme-gold-light);
    background: rgba(217, 170, 66, 0.07);
}

html body .sidebar-menu-item a.active {
    color: var(--theme-gold-light);
    background: linear-gradient(90deg, rgba(197, 43, 66, 0.28), rgba(197, 43, 66, 0.05));
    box-shadow: inset 0 0 0 1px rgba(217, 170, 66, 0.22);
}

html body .sidebar-menu-item a.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--theme-gold-light), var(--theme-gold));
    box-shadow: 0 0 8px rgba(217, 170, 66, 0.6);
}

html body .icon-wrapper {
    color: var(--theme-gold-light) !important;
    background: rgba(217, 170, 66, 0.1) !important;
    border: 1px solid rgba(217, 170, 66, 0.25) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

html body .sidebar-menu-item a:hover .icon-wrapper {
    background: rgba(217, 170, 66, 0.18) !important;
    border-color: rgba(217, 170, 66, 0.5) !important;
}

html body .sidebar-menu-item a.active .icon-wrapper {
    color: #fff !important;
    background: linear-gradient(135deg, var(--theme-maroon), var(--theme-maroon-dark)) !important;
    border-color: rgba(241, 213, 139, 0.5) !important;
    box-shadow: 0 4px 14px rgba(197, 43, 66, 0.45) !important;
}

html body .active-indicator {
    color: var(--theme-gold);
}

html body .sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 24px;
    color: var(--theme-gold);
    font-size: 10.5px;
    letter-spacing: 1.4px;
    opacity: 0.85;
}

html body .sidebar-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(217, 170, 66, 0.35), transparent);
}

html body .sidebar-divider {
    border-top-color: rgba(217, 170, 66, 0.15) !important;
}

html body #leftOffcanvas .offcanvas-body {
    scrollbar-color: rgba(217, 170, 66, 0.35) transparent;
}

html body #leftOffcanvas .offcanvas-body::-webkit-scrollbar-track {
    background: transparent;
}

html body #leftOffcanvas .offcanvas-body::-webkit-scrollbar-thumb {
    background: rgba(217, 170, 66, 0.35);
}

html body .btn-primary {
    color: #fff;
    background: var(--theme-maroon);
    border-color: var(--theme-maroon);
}

html body .btn-primary:hover,
html body .btn-primary:focus,
html body .btn-primary:active {
    color: #fff !important;
    background: var(--theme-maroon-dark) !important;
    border-color: var(--theme-maroon-dark) !important;
}

html body .btn-warning {
    color: var(--theme-maroon-dark);
    background: var(--theme-gold);
    border-color: var(--theme-gold);
}

html body .form-control:focus,
html body .form-select:focus {
    border-color: var(--theme-gold);
    box-shadow: 0 0 0 0.2rem rgba(255, 201, 40, 0.3);
}

html body a {
    color: var(--theme-maroon);
}

html body .text-primary,
html body .text-primary-custom {
    color: var(--theme-maroon) !important;
}

html body .page-header-card {
    background: linear-gradient(135deg, var(--theme-navy-soft), var(--theme-navy-card));
    border-bottom: 1px solid var(--theme-border);
}

html body .page-header-title,
html body .section-title {
    color: var(--theme-maroon-dark);
}

html body .page-header-subtitle,
html body .section-subtitle {
    color: var(--theme-muted);
}

html body .page-app-body,
html body .cards-wrap .card-item,
html body .home-opt-card {
    color: var(--theme-text);
    background: linear-gradient(160deg, var(--theme-navy-card), var(--theme-navy-soft)) !important;
    border-color: var(--theme-border) !important;
    box-shadow: 4px 6px 0 rgba(255, 201, 40, 0.85);
}

html body .card-item span,
html body .card-item a,
html body .home-opt-card a {
    color: var(--theme-text);
}

html body .card-item::before {
    background: linear-gradient(90deg, var(--theme-maroon), var(--theme-orange));
}

html body .home-greeting-wrap::after {
    border: 1px solid rgba(217, 170, 66, 0.5);
    background:
        linear-gradient(125deg, rgba(116, 23, 43, 0.96), rgba(48, 24, 40, 0.98)),
        radial-gradient(70% 100% at 85% 0%, rgba(217, 170, 66, 0.22), transparent);
    box-shadow: var(--theme-shadow);
}

html body .home-greeting-kicker {
    color: var(--theme-gold-light);
    background: rgba(255, 201, 40, 0.12);
    border-color: rgba(255, 226, 138, 0.45);
}

html body .home-greeting-title {
    color: #fff;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

html body .home-greeting-subtitle {
    color: #ffe9a9;
}

html body .focus-mood-card,
html body .focus-mood-insight,
html body .focus-mood-topic-card,
html body .focus-mood-lucky-card,
html body .hd-card,
html body .hx-tarot-reading,
html body .hx-modal-section,
html body .daily-horo-card,
html body .cosmic-card,
html body .articles-section .article-card {
    color: var(--theme-text) !important;
    background: linear-gradient(160deg, rgba(59, 16, 25, 0.98), rgba(35, 8, 15, 0.98)) !important;
    border-color: var(--theme-border) !important;
    box-shadow: var(--theme-shadow) !important;
}

html body .focus-mood-header h3,
html body .focus-mood-insight h4,
html body .focus-mood-topic-card h5,
html body .hd-header h3,
html body .hd-period h4,
html body .daily-horo-title,
html body .daily-horo-sign-name,
html body .daily-horo-summary,
html body .cosmic-card-title {
    color: var(--theme-gold-light) !important;
}

html body .focus-mood-tabs {
    background: rgba(24, 7, 11, 0.94);
    border-color: var(--theme-border);
}

html body .focus-mood-tab,
html body .focus-mood-topic-card p,
html body .focus-mood-insight p,
html body .hd-header p,
html body .hd-note,
html body .hd-message,
html body .daily-horo-date,
html body .daily-horo-metric-label,
html body .metric-label {
    color: var(--theme-muted) !important;
}

html body .focus-mood-tab.is-active {
    color: #fff !important;
    background: var(--theme-maroon);
    box-shadow: 0 6px 14px rgba(143, 0, 38, 0.22);
}

html body .focus-mood-info,
html body .focus-mood-insight-icon,
html body .hd-icon {
    color: var(--theme-maroon);
    background: rgba(255, 201, 40, 0.12);
    border-color: var(--theme-border);
}

html body .focus-mood-ring::before {
    background: var(--theme-navy-soft);
}

html body .focus-mood-ring span,
html body .focus-mood-item p,
html body .focus-mood-lucky-value {
    color: var(--theme-text) !important;
}

html body .hd-profile-controls select,
html body .hd-period,
html body .hd-action,
html body .hx-time-row,
html body .hx-chart-links a,
html body .daily-horo-metric,
html body .metric-chip {
    color: var(--theme-text) !important;
    background: rgba(24, 7, 11, 0.82) !important;
    border-color: var(--theme-border) !important;
}

html body .hd-label,
html body .hd-action,
html body .hx-links a,
html body .hx-reveal,
html body .daily-horo-viewall {
    color: var(--theme-gold-light) !important;
}

html body .hd-profile-controls button {
    color: #fff;
    background: var(--theme-maroon);
    border-color: var(--theme-maroon);
}

html body .hx-modal-content {
    color: var(--theme-text);
    background: var(--theme-navy-soft);
    border-color: var(--theme-border);
}

html body .hx-modal-title-group h3,
html body .hx-modal-section h4,
html body .hx-modal-section h4 i {
    color: var(--theme-maroon) !important;
}

html body .hx-modal-section p {
    color: var(--theme-text);
}

html body .main-sidebar {
    background: linear-gradient(180deg, var(--theme-maroon-dark), var(--theme-maroon)) !important;
}

html body .nav-sidebar .nav-link {
    color: #ffeeb7 !important;
}

html body .nav-sidebar .nav-link:hover,
html body .nav-sidebar .nav-link.active {
    color: var(--theme-maroon-dark) !important;
    background: var(--theme-gold) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

html body .nav-header {
    color: var(--theme-gold-light) !important;
}

html body .brand-link,
html body .brand-text {
    color: #fff !important;
}

html body .modal-content {
    background: #fffdf6;
    border-color: var(--theme-border);
}

html body .modal-header {
    background: linear-gradient(135deg, var(--theme-gold-light), var(--theme-gold-pale));
    border-bottom-color: var(--theme-border);
}

html body .modal-title {
    color: var(--theme-maroon-dark);
}

html body .dropdown-item.active,
html body .dropdown-item:active {
    color: #fff;
    background: var(--theme-maroon);
}

html body .pagination .page-link {
    color: var(--theme-maroon);
    border-color: var(--theme-border);
}

html body .pagination .active > .page-link,
html body .pagination .page-link:hover {
    color: #fff;
    background: var(--theme-maroon);
    border-color: var(--theme-maroon);
}

html body .error-icon,
html body .cosmic-decoration i {
    color: var(--theme-maroon);
}

html body .btn-home {
    color: var(--theme-maroon-dark);
    background: linear-gradient(135deg, var(--theme-gold-light), var(--theme-gold));
    box-shadow: 0 4px 15px rgba(143, 0, 38, 0.16);
}

html body .btn-home:hover {
    color: var(--theme-maroon-dark);
}

@media (min-width: 501px) {
    html body {
        background: #020812;
    }

    html body .mobile-viewport {
        position: relative;
        width: 100%;
        max-width: 500px;
        min-height: 100vh;
        margin: 0 auto;
        overflow-x: hidden;
        box-shadow: 0 0 55px rgba(0, 0, 0, 0.42);
    }

    html body .navbar.fixed-top,
    html body .navbar.fixed-bottom {
        left: 50% !important;
        right: auto !important;
        width: 100% !important;
        max-width: 500px !important;
        transform: translateX(-50%);
    }

    html body .offcanvas-start-custom,
    html body .offcanvas-start {
        left: calc(50% - 250px) !important;
    }

    html body .modal-dialog {
        max-width: 460px;
        margin: 1.75rem auto;
    }

    html body .modal,
    html body .modal-backdrop,
    html body .offcanvas-backdrop {
        left: 50% !important;
        right: auto !important;
        width: 100% !important;
        max-width: 500px !important;
        transform: translateX(-50%);
    }

    html body .modal {
        z-index: 1060 !important;
    }
}

/* ================= Header v2 (U9 palette) ================= */
html body .navbar.fixed-top {
    background:
        radial-gradient(60% 140% at 50% -30%, rgba(245, 220, 128, 0.28), transparent 60%),
        linear-gradient(180deg, #73123f 0%, #4c0a28 55%, #260617 100%) !important;
    box-shadow: 0 8px 22px rgba(38, 6, 23, 0.6);
}

/* faint twinkling stars */
html body .navbar.fixed-top::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='56'%3E%3Cg fill='%23f5dc80'%3E%3Ccircle cx='14' cy='12' r='.8'/%3E%3Ccircle cx='62' cy='40' r='.6'/%3E%3Ccircle cx='118' cy='9' r='.7'/%3E%3Ccircle cx='160' cy='34' r='.9'/%3E%3Ccircle cx='96' cy='48' r='.5'/%3E%3C/g%3E%3C/svg%3E") repeat-x;
    opacity: 0.55;
    animation: hdr-twinkle 4s ease-in-out infinite;
    pointer-events: none;
}

html body .navbar .container-fluid { position: relative; z-index: 1; }

html body .navbar-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    filter: none;
    background: none;
    -webkit-text-fill-color: initial;
}

html body .navbar-brand::before,
html body .navbar-brand::after { display: none; }

.brand-mark {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    overflow: visible;
    filter: drop-shadow(0 0 6px rgba(245, 220, 128, 0.55));
}

.brand-mark * { transform-box: view-box; transform-origin: 16px 16px; }
.brand-halo { animation: hdr-spin 18s linear infinite; }
.brand-orbit { animation: hdr-spin 7s linear infinite; }
.brand-moon { animation: hdr-glow 3.5s ease-in-out infinite; }

.brand-text {
    font-family: 'OpenSans-ExtraBold', sans-serif;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: transparent;
    background: linear-gradient(100deg, #f5dc80 0%, #ddad2f 30%, #fff8e9 45%, #ddad2f 60%, #f5dc80 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: hdr-shine 5s linear infinite;
}

.brand-text b { font-weight: 800; }

html body .nav-button {
    color: #f5dc80;
    background: rgba(38, 6, 23, 0.45);
    border-color: rgba(245, 220, 128, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 248, 233, 0.08);
}

html body .nav-button:hover { background: rgba(245, 220, 128, 0.14); }

html body .navbar.fixed-top::after {
    background: linear-gradient(90deg, transparent, #ddad2f 25%, #f5dc80 50%, #ddad2f 75%, transparent);
}

@keyframes hdr-spin { to { transform: rotate(360deg); } }
@keyframes hdr-glow { 0%, 100% { opacity: 0.9; } 50% { opacity: 1; filter: brightness(1.15); } }
@keyframes hdr-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes hdr-twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.75; } }

@media (prefers-reduced-motion: reduce) {
    html body .navbar.fixed-top::before, .brand-mark *, .brand-text { animation: none !important; }
}

/* ================= Language modal (U9 palette) ================= */
html body .lang-modal-backdrop { background: #12030b; }
html body .lang-modal-backdrop.show { opacity: 0.75; }
html body .lang-modal .modal-dialog { max-width: 360px; padding: 0 14px; }

html body .lang-modal-content {
    overflow: hidden;
    border: 1px solid rgba(221, 173, 47, 0.45) !important;
    border-radius: 22px !important;
    color: #f4e6d0;
    background:
        radial-gradient(80% 40% at 50% 0%, rgba(245, 220, 128, 0.18), transparent 70%),
        linear-gradient(170deg, #4c0a28 0%, #3a0820 45%, #260617 100%) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 248, 233, 0.1);
    animation: lang-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

html body .lang-modal-head {
    position: relative;
    padding: 22px 20px 16px;
    text-align: center;
}

html body .lang-modal-head::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddad2f, transparent);
}

html body .lang-modal-icon {
    display: inline-grid;
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
    place-items: center;
    border: 1px solid rgba(245, 220, 128, 0.4);
    border-radius: 50%;
    color: #f5dc80;
    background: radial-gradient(circle at 40% 35%, rgba(245, 220, 128, 0.25), rgba(38, 6, 23, 0.6));
    box-shadow: 0 0 18px rgba(221, 173, 47, 0.3);
}

html body .lang-modal-icon svg { animation: hdr-spin 20s linear infinite; }

html body .lang-modal-head h5 { margin: 0; color: #fff; font-family: 'OpenSans-ExtraBold', sans-serif; font-size: 19px; font-weight: 800; }
html body .lang-modal-head p { margin: 4px 0 0; color: #bc98a9; font-size: 12px; }

html body .lang-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(245, 220, 128, 0.3);
    border-radius: 10px;
    color: #f5dc80;
    background: rgba(38, 6, 23, 0.5);
}

html body .lang-modal-close:hover { background: rgba(245, 220, 128, 0.15); }

html body .lang-modal-body { max-height: 55vh; padding: 16px; overflow-y: auto; }

html body .lang-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

html body .lang-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 104px;
    padding: 14px 8px 12px;
    border: 1px solid rgba(245, 220, 128, 0.16);
    border-radius: 16px;
    color: inherit;
    background: linear-gradient(170deg, rgba(115, 18, 63, 0.45), rgba(38, 6, 23, 0.6));
    transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

html body .lang-option:hover { border-color: rgba(245, 220, 128, 0.5); background: linear-gradient(170deg, rgba(159, 32, 89, 0.5), rgba(38, 6, 23, 0.6)); }
html body .lang-option:active { transform: scale(0.97); }
html body .lang-option:focus-visible { outline: 2px solid #f5dc80; outline-offset: 2px; }

html body .lang-option-icon {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 6px;
    place-items: center;
    border-radius: 12px;
    background: rgba(245, 220, 128, 0.1);
    font-size: 22px;
}

html body .lang-option-icon img { width: 24px; height: 24px; object-fit: contain; }
html body .lang-option-label { color: #fff; font-size: 14px; font-weight: 800; }
html body .lang-option-native { color: #bc98a9; font-size: 12px; }

html body .lang-option.is-active {
    border-color: #f5dc80;
    background:
        radial-gradient(90% 70% at 50% 0%, rgba(245, 220, 128, 0.22), transparent 70%),
        linear-gradient(170deg, #73123f, #3a0820);
    box-shadow: 0 0 0 1px rgba(245, 220, 128, 0.4), 0 8px 20px rgba(221, 173, 47, 0.2);
}

html body .lang-option.is-active .lang-option-native { color: #f5dc80; }

html body .lang-option-check {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    color: #260617;
    background: #f5dc80;
    font-size: 11px;
    font-weight: 900;
}

html body .lang-modal-foot {
    padding: 11px;
    border-top: 1px solid rgba(245, 220, 128, 0.12);
    color: #bc98a9;
    background: rgba(18, 3, 11, 0.4);
    font-size: 11px;
    text-align: center;
}

@keyframes lang-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    html body .lang-modal-content, html body .lang-modal-icon svg { animation: none !important; }
}

/* ================= Language modal v2: simple list ================= */
html body .lang-modal .modal-dialog {
    width: calc(100% - 32px);
    max-width: 340px;
    margin: 1.75rem auto !important;
    padding: 0;
}

html body .lang-modal-content {
    border-radius: 20px !important;
    background: linear-gradient(170deg, #4c0a28 0%, #2e0719 100%) !important;
}

/* compact header: title left, close right */
html body .lang-modal-head { padding: 18px 56px 14px 18px; text-align: left; }
html body .lang-modal-head::after { left: 0; right: 0; background: rgba(245, 220, 128, 0.15); }
html body .lang-modal-icon { display: none; }
html body .lang-modal-head h5 { font-size: 17px; }
html body .lang-modal-head p { margin-top: 2px; font-size: 11.5px; }
html body .lang-modal-close { top: 50%; transform: translateY(-50%); }

/* one row per language */
html body .lang-modal-body { padding: 10px; }
html body .lang-grid { grid-template-columns: 1fr; gap: 6px; }

html body .lang-option {
    display: grid;
    grid-template-columns: 40px 1fr 22px;
    grid-template-areas: "icon label check" "icon native check";
    align-items: center;
    column-gap: 12px;
    min-height: 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    text-align: left;
}

html body .lang-option:hover { border-color: rgba(245, 220, 128, 0.25); background: rgba(245, 220, 128, 0.06); }

html body .lang-option-icon { grid-area: icon; width: 40px; height: 40px; margin: 0; border-radius: 12px; font-size: 20px; }
html body .lang-option-label { grid-area: label; align-self: end; font-size: 14.5px; line-height: 1.2; }
html body .lang-option-native { grid-area: native; align-self: start; font-size: 12px; line-height: 1.3; }

/* radio-style indicator */
html body .lang-option::after {
    content: "";
    grid-area: check;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(245, 220, 128, 0.35);
    border-radius: 50%;
}

html body .lang-option.is-active {
    border-color: rgba(245, 220, 128, 0.55);
    background: rgba(245, 220, 128, 0.1);
    box-shadow: none;
}

html body .lang-option.is-active::after { display: none; }

html body .lang-option-check {
    position: static;
    grid-area: check;
    width: 22px;
    height: 22px;
}

html body .lang-modal-foot { padding: 10px; font-size: 10.5px; }

/* ================= Language modal v3: refined boxed rows ================= */
html body .lang-modal-head { padding: 18px 58px 14px 18px; }
html body .lang-modal-head p { color: #c9a7b6; }

html body .lang-option {
    position: relative;
    overflow: hidden;
    grid-template-areas: "icon label check" "icon native check";
    border: 1px solid rgba(245, 220, 128, 0.1);
    background: linear-gradient(120deg, rgba(115, 18, 63, 0.35), rgba(38, 6, 23, 0.45));
    animation: lang-row-in 0.35s ease-out both;
}

/* single-line rows when there is no separate native name */
html body .lang-option:not(:has(.lang-option-native)) .lang-option-label { grid-row: 1 / span 2; align-self: center; }

html body .lang-option-icon {
    background: linear-gradient(145deg, rgba(245, 220, 128, 0.18), rgba(245, 220, 128, 0.05));
    box-shadow: inset 0 0 0 1px rgba(245, 220, 128, 0.18);
}


/* selected: gold accent bar + filled radio */
html body .lang-option.is-active {
    border-color: rgba(245, 220, 128, 0.6);
    background:
        radial-gradient(80% 140% at 0% 50%, rgba(245, 220, 128, 0.2), transparent 70%),
        linear-gradient(120deg, #73123f, #3a0820);
}

html body .lang-option.is-active::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #fff8e9, #ddad2f);
    box-shadow: 0 0 8px rgba(245, 220, 128, 0.8);
}

html body .lang-option.is-active .lang-option-icon { background: linear-gradient(145deg, #f5dc80, #ddad2f); box-shadow: 0 4px 12px rgba(221, 173, 47, 0.35); }

html body .lang-option-check { box-shadow: 0 0 10px rgba(245, 220, 128, 0.6); }

/* tap feedback: radio fills gold */
html body .lang-option:active::after { border-color: #f5dc80; background: radial-gradient(circle, #f5dc80 45%, transparent 50%); }

html body .lang-modal-foot { color: #a98596; }

@keyframes lang-row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { html body .lang-option { animation: none; } }
