/* MU World V2: legacy shell rules moved verbatim out of the inline <style> block of empire-v2-index.tpl.
   Every rule is scoped with :where(body[data-mu-preview]) so V1 never sees it while the original
   specificity is preserved (the :where() prefix adds none). Kept: rules that content templates still
   use and no V2 stylesheet fully overrides. Dropped: SweetAlert iOS skin, Nunito import, dock
   (.auth-x and .nav-x), body and #index_content (all redefined with !important in v2.css). */

/* Unified Neo Frame variables (consumed only by the hero rules below). */
:where(body[data-mu-preview]) {
    --neo-hero-gap: clamp(10px, 2vh, 18px);
    --neo-hero-pad-y: clamp(12px, 2.4vw, 20px);
    --neo-hero-pad-x: clamp(8px, 2vw, 14px);
    --neo-hero-radius: clamp(16px, 3vw, 24px);
    --neo-title-size: 0.9rem;
    --neo-title-line: 1.03;
    --neo-title-track: 0.035em;
    --neo-sub-size: 0.69rem;
    --neo-sub-line: 1.1;
    --neo-title-gap: 10px;
}

/* Shared hero frame (recharge.tpl .rc-*, giftcode.tpl .giftcode-neo-*, lotto2d/xsmb .lt-*) */
:where(body[data-mu-preview]) :is(.rc-hero, .giftcode-neo-hero, .gm-hero, .gmv-hero, .gmb-hero, .lt-topbar, .rk-hero) {
    margin-bottom: var(--neo-hero-gap) !important;
    padding: var(--neo-hero-pad-y) var(--neo-hero-pad-x) !important;
    border-radius: var(--neo-hero-radius) !important;
}

/* Shared title row and left block */
:where(body[data-mu-preview]) :is(.rc-title-row, .giftcode-neo-title-row, .gm-title-row, .gmv-title-row, .gmb-title-row, .lt-topbar-inner, .rk-title-row) {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--neo-title-gap);
}

:where(body[data-mu-preview]) :is(.rc-title-left, .giftcode-neo-title-left, .gm-title-left, .gmv-title-left, .gmb-title-left, .lt-top-title) {
    display: flex;
    align-items: center;
    gap: var(--neo-title-gap);
    min-width: 0;
}

/* Shared icon size */
:where(body[data-mu-preview]) :is(.rc-title-icon, .giftcode-neo-title-icon, .gm-title-icon, .gmv-title-icon, .gmb-title-icon) {
    width: 36px !important;
    height: 36px !important;
    border-radius: 12px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(165deg, rgba(255,255,255,0.94), rgba(210,232,252,0.7));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 8px 16px rgba(34,97,155,0.18);
    color: rgba(29,83,133,0.95);
    flex-shrink: 0;
}

:where(body[data-mu-preview]) .lt-top-title .lt-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 12px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(165deg, rgba(255,255,255,0.94), rgba(210,232,252,0.7));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 8px 16px rgba(34,97,155,0.18);
    color: rgba(29,83,133,0.95);
    flex-shrink: 0;
}

/* Shared title copy block */
:where(body[data-mu-preview]) :is(.rc-hero-copy, .giftcode-neo-title-copy, .gm-hero-copy, .gmv-hero-copy, .gmb-hero-copy, .lt-top-copy, .rk-hero-copy) {
    position: relative;
    z-index: 1;
    min-height: 36px !important;
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Shared title typography */
:where(body[data-mu-preview]) :is(.rc-title-text, .giftcode-neo-title, .gm-title, .gmv-title, .gmb-title, .lt-top-heading, .rk-title-text) {
    margin: 0 !important;
    font-size: var(--neo-title-size) !important;
    line-height: var(--neo-title-line) !important;
    font-weight: 800 !important;
    letter-spacing: var(--neo-title-track) !important;
    text-transform: none;
    color: var(--neo-blue-ink, rgba(10,42,77,0.92));
}

/* Shared subtitle typography */
:where(body[data-mu-preview]) :is(.rc-subtitle, .giftcode-neo-subtitle, .gm-subtitle, .gmv-subtitle, .gmb-subtitle, .lt-top-sub, .rk-subtitle) {
    margin: 2px 0 0 !important;
    font-size: var(--neo-sub-size) !important;
    line-height: var(--neo-sub-line) !important;
    font-weight: 700 !important;
    color: rgba(18,58,96,0.74);
}

/* Shared compact mode for mobile landscape */
@media (max-width: 1024px) and (orientation: landscape) {
    :where(body[data-mu-preview]) :is(.rc-hero, .giftcode-neo-hero, .gm-hero, .gmv-hero, .gmb-hero, .lt-topbar, .rk-hero) {
        padding: 10px 8px !important;
        margin-bottom: 8px !important;
    }

    :where(body[data-mu-preview]) :is(.rc-title-text, .giftcode-neo-title, .gm-title, .gmv-title, .gmb-title, .lt-top-heading, .rk-title-text) {
        font-size: 1rem !important;
    }

    :where(body[data-mu-preview]) :is(.rc-subtitle, .giftcode-neo-subtitle, .gm-subtitle, .gmv-subtitle, .gmb-subtitle, .lt-top-sub, .rk-subtitle) {
        font-size: 0.74rem !important;
    }

    :where(body[data-mu-preview]) .lt-tabs {
        padding: 2px !important;
        margin-bottom: 8px !important;
    }

    :where(body[data-mu-preview]) .lt-tab-btn {
        padding: 7px 2px !important;
        font-size: clamp(0.76rem, 1.8vw, 0.86rem) !important;
    }
}

/* Lang Grid (still rendered by account/login.tpl for guests; the dock copy is hidden by v2.css) */
:where(body[data-mu-preview]) .lang-grid-menu {
    border-radius: 16px !important; padding: 10px !important; min-width: auto !important;
    display: none; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px !important;
    box-shadow: 0 12px 30px rgba(15,23,42,0.1) !important; border: 1px solid rgba(255,255,255,0.4) !important;
    background: rgba(255,255,255,0.9) !important; backdrop-filter: blur(12px);
}
:where(body[data-mu-preview]) .lang-grid-menu.show { display: grid !important; }
:where(body[data-mu-preview]) .lang-grid-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    border-radius: 10px; text-decoration: none; color: #334155;
    font-size: 0.95rem; font-weight: 700; white-space: nowrap; transition: background 0.15s;
}
:where(body[data-mu-preview]) .lang-grid-item:hover { background: #f1f5f9; color: #0f172a; }
:where(body[data-mu-preview]) .lang-grid-item img { height: 18px; border-radius: 3px; flex-shrink: 0; }
:where(body[data-mu-preview]) .lang-row-item { grid-column: 1 / -1; }
:where(body[data-mu-preview]) .dropdown-toggle::after { display: none !important; }

/* Lang menu placement next to the guest login dock (portrait / landscape) */
@media (max-aspect-ratio: 6/5) {
    :where(body[data-mu-preview]) .nav-lang-wrap .btn-lang::after { display: none !important; }
    :where(body[data-mu-preview]) .nav-lang-wrap .lang-grid-menu {
        top: auto !important; bottom: calc(100% + 8px) !important;
        right: 0 !important; left: auto !important;
        transform: none !important; margin-top: 0 !important; z-index: 40;
    }
}
@media (min-aspect-ratio: 6/5) {
    :where(body[data-mu-preview]) .nav-lang-wrap .lang-grid-menu {
        top: auto !important; left: calc(100% + 12px) !important;
        transform: none !important; bottom: 0 !important; position: absolute !important;
        display: none; grid-template-columns: repeat(4, 1fr) !important; gap: 6px;
    }
    :where(body[data-mu-preview]) .lang-row-item { grid-column: auto; }
}

/* Glass overrides for mu_user components (V1 pages not yet restyled for V2) */
:where(body[data-mu-preview]) :is(.webbg-s1, .webbg-userbar, .list-group-item) {
    background-color: rgba(255,255,255,0.6) !important;
    backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255,255,255,0.5) !important; border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.03) !important; margin-bottom: 8px !important;
}
:where(body[data-mu-preview]) .list-group { background: transparent !important; }
:where(body[data-mu-preview]) .webbg-userbar { background-image: none !important; }
:where(body[data-mu-preview]) .btn:not(.nav-btn) { border-radius: 14px !important; font-weight: 700 !important; letter-spacing: 0.5px !important; font-family: 'Nunito Sans', sans-serif !important; }
:where(body[data-mu-preview]) .btn-primary { background: #3b82f6 !important; border: none !important; box-shadow: 0 4px 12px rgba(59,130,246,0.3) !important; }
:where(body[data-mu-preview]) .btn-primary:active { transform: scale(0.96) !important; }
:where(body[data-mu-preview]) :is(.box, .panel, .card) {
    background: rgba(255,255,255,0.5) !important; backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important;
    border-radius: 16px !important; border: 1px solid rgba(255,255,255,0.6) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05) !important; overflow: hidden;
}
:where(body[data-mu-preview]) .breadcrumb { background: transparent !important; padding: 0 !important; margin-bottom: 0 !important; font-weight: 700 !important; }
:where(body[data-mu-preview]) .breadcrumbBar { padding-bottom: 0 !important; margin-bottom: 15px !important; }
