/* ============================================================
   MODERN THEME — "Nebula" redesign for the app store landing
   Loaded AFTER style.css / dm.css / lm.css / accent css.
   Keeps every JS hook (.ar-wa-*, .listing-item, .appdet-*, ...).
   ============================================================ */

:root {
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --radius-xl: 32px;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --speed: .28s;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-sm: 0 4px 14px rgba(10, 16, 38, .06);
    --shadow-md: 0 12px 34px rgba(10, 16, 38, .10);
    --shadow-lg: 0 26px 60px rgba(10, 16, 38, .16);

    /* Fallback accent (overridden inline from admin picker) */
    --accent: #7c3aed;
    --accent-rgb: 124, 58, 237;
    --accent-soft: rgba(var(--accent-rgb), .14);
    --accent-glow: 0 10px 30px rgba(var(--accent-rgb), .35);
}

/* Dark (default) palette */
.cm-d {
    --bg: #070b15;
    --bg-soft: #0d1424;
    --surface: #131c30;
    --surface-2: #18233c;
    --surface-3: #1e2a47;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .14);
    --text: #e8edff;
    --muted: #8d97b8;
    --faint: #5f6a8c;
    --glow: rgba(var(--accent-rgb), .28);
}

/* Light palette */
.cm-l {
    --bg: #eef2fd;
    --bg-soft: #f4f7ff;
    --surface: #ffffff;
    --surface-2: #f7f9ff;
    --surface-3: #eef2fc;
    --border: rgba(15, 23, 42, .08);
    --border-strong: rgba(15, 23, 42, .16);
    --text: #0f1735;
    --muted: #5c6790;
    --faint: #8b93b3;
    --glow: rgba(var(--accent-rgb), .16);
}

/* ------------------------------------------------------------
   Base
------------------------------------------------------------ */
body.page-body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    letter-spacing: .01em;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    letter-spacing: -.02em;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), .35);
    border-radius: 50px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), .55); }

/* ------------------------------------------------------------
   Page shell
------------------------------------------------------------ */
.ar-wa-s {
    padding: 22px;
    min-height: 100vh;
    background:
        radial-gradient(1100px 500px at 8% -10%, rgba(var(--accent-rgb), .16), transparent 60%),
        radial-gradient(900px 480px at 100% 0%, rgba(var(--accent-rgb), .10), transparent 55%),
        var(--bg);
}

.ar-wa-w {
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
    border-radius: var(--radius-xl);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ------------------------------------------------------------
   Header
------------------------------------------------------------ */
.ar-wa-header {
    position: relative;
    display: flex;
    align-items: center;
    height: 96px;
    padding: 12px 34px;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    transition: height .3s var(--ease), padding .3s var(--ease), box-shadow .3s var(--ease);
    z-index: 40;
}

.ar-wa-header.sticky-header {
    height: 70px;
    padding: 8px 34px;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: var(--shadow-md);
}

.ar-wa-header-content { display: flex; width: 100%; align-items: center; justify-content: space-between; }
.ar-wa-header-content-l { display: flex; align-items: center; min-width: 0; }
.ar-wa-header-content-r { display: flex; align-items: center; gap: 12px; }

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), .9), rgba(var(--accent-rgb), .45));
    box-shadow: var(--accent-glow);
    padding: 6px;
    flex: 0 0 auto;
}

.header-logo-img {
    max-width: 100%;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25));
}

.ar-wa-header-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0 14px;
    letter-spacing: -.03em;
    background: linear-gradient(90deg, var(--text) 40%, rgba(var(--accent-rgb), 1));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Color mode toggle */
.color-mode-btn {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.color-mode-btn:hover {
    transform: translateY(-2px) rotate(8deg);
    border-color: rgba(var(--accent-rgb), .5);
    box-shadow: var(--accent-glow);
}

.color-mode-btn-icon { width: 20px; }

/* Search */
.search-form-wrapper { max-width: 420px; width: 100%; }
.search-input {
    width: 100%;
    min-width: 320px;
    height: 46px;
    padding: 0 18px 0 52px;
    font-size: .95rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.search-input::placeholder { color: var(--muted); opacity: 1; }

.search-input:focus {
    outline: none;
    border-color: rgba(var(--accent-rgb), .55);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-input-wrapper .search-icon {
    position: absolute;
    width: 20px;
    top: 13px;
    left: 19px;
    opacity: .85;
}

/* ------------------------------------------------------------
   Layout columns
------------------------------------------------------------ */
.ar-wa-f-w { display: flex; flex-wrap: wrap; }
.ar-wa-f-l-w { width: 300px; flex: 0 0 300px; }
.ar-wa-f-r-w {
    width: calc(100% - 300px);
    border-radius: 0;
    position: relative;
    background: var(--bg-soft);
}

.ar-wa-discover, .ar-wa-games, .ar-wa-apps, .ar-wa-search, .ar-wa-det { min-height: 74vh; position: relative; }
.ar-wa-games, .ar-wa-apps, .ar-wa-discover, .ar-wa-search { padding: 30px 34px; }

/* ------------------------------------------------------------
   Side nav
------------------------------------------------------------ */
.ar-wa-view-nav { padding: 38px 22px 22px 22px; }

.ar-wa-view-nav ul { padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }

.ar-wa-view-nav-item {
    display: flex;
    align-items: center;
    padding: 13px 16px;
    border-radius: 16px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--speed) var(--ease);
}

.ar-wa-view-nav-item:hover {
    background: var(--surface-2);
    color: var(--text);
    transform: translateX(4px);
}

.ar-wa-view-nav-item.ar-wa-view-nav-item-active {
    background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .55));
    color: #fff;
    border-color: transparent;
    box-shadow: var(--accent-glow);
    transform: none;
}

.ar-wa-view-nav-item.ar-wa-view-nav-item-active:hover { transform: none; }

.ar-wa-view-nav-item.inactive-nav {
    opacity: .5;
    pointer-events: none !important;
}

.ar-wa-nav-icon { width: 20px; margin-right: 11px; }

.ar-wa-view-nav-item span { font-size: .95rem; }

/* ------------------------------------------------------------
   Section titles
------------------------------------------------------------ */
.section-title-wrapper { margin-bottom: 16px; }

.section-title-wrapper h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.section-title-wrapper h3::after {
    content: '';
    height: 4px;
    width: 34px;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.section-title-cat-sec-w { display: flex; justify-content: space-between; align-items: center; }

.stw-view-all {
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
    padding: 7px 14px;
    border-radius: 50px;
    background: var(--accent-soft);
    cursor: pointer;
    transition: all var(--speed) var(--ease);
}

.stw-view-all:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--accent-glow);
}

/* ------------------------------------------------------------
   Featured hero
------------------------------------------------------------ */
.featured-section { margin-bottom: 30px; }

.featured-apps-content-l { overflow: hidden; border-radius: var(--radius-lg); }

.featured-app-slider-item {
    padding: 22px;
    cursor: pointer;
    border-radius: var(--radius-lg);
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    display: flex;
    align-items: flex-end;
    height: 260px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.featured-app-slider-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(14px) saturate(1.2);
    transform: scale(1.12);
    transition: transform .5s var(--ease);
    z-index: 0;
}

.featured-app-slider-item:hover::before { transform: scale(1.18); }

.featured-app-slider-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(4, 8, 20, .88) 0%, rgba(4, 8, 20, .45) 45%, rgba(4, 8, 20, .05) 100%);
    z-index: 1;
}

.featured-app-content { color: #fff; z-index: 2; position: relative; display: flex; align-items: center; width: 100%; }

.featured-app-c-l { flex: 0 0 auto; }

.featured-app-slider-item-img {
    border-radius: 18px;
    display: block;
    max-width: 96px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
    border: 2px solid rgba(255, 255, 255, .18);
}

.featured-app-c-r { padding-left: 18px; min-width: 0; }

.featured-app-tr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.featured-app-slider-item-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}

.featured-app-slider-item .listing-item-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: 50px;
    background: var(--accent);
    color: #fff;
    font-size: .82rem;
    box-shadow: var(--accent-glow);
}

.featured-app-slider-item .listing-item-rating .listing-item-meta-icon { width: 14px; filter: invert(1); }

.featured-app-d {
    margin-top: 10px;
    font-size: .95rem;
    color: rgba(255, 255, 255, .85);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ------------------------------------------------------------
   Trending
------------------------------------------------------------ */
.trending-section { margin-bottom: 30px; }

.trending-apps-w {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 14px;
    padding: 6px 4px 14px;
    scroll-snap-type: x mandatory;
}

.trending-apps-w::-webkit-scrollbar { height: 6px; }
.trending-apps-w::-webkit-scrollbar-track { background: transparent; }
.trending-apps-w::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), .35); border-radius: 50px; }

.trending-app-item {
    padding: 0;
    width: 150px;
    flex: 0 0 150px;
    text-align: center;
    scroll-snap-align: start;
}

.trending-app-content {
    padding: 18px 14px 16px;
    cursor: pointer;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--speed) var(--ease);
}

.trending-app-content:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--accent-rgb), .45);
    box-shadow: var(--accent-glow);
}

.trending-app-c-l { width: 76px; margin: 0 auto 12px; }

.trending-app-item-img {
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    transition: transform var(--speed) var(--ease);
}

.trending-app-content:hover .trending-app-item-img { transform: scale(1.08) rotate(-2deg); }

.trending-app-slider-item-name {
    font-weight: 700;
    font-size: .92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-item-category { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; }

.listing-item-category-val {
    font-size: .76rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 3px 10px;
    border-radius: 50px;
    display: inline-block;
}

.cat-icon { width: 14px; display: none; }

/* ------------------------------------------------------------
   Listing rows (homepage)
------------------------------------------------------------ */
.listing-section { position: relative; }

.listing-content { display: flex; flex-wrap: wrap; margin: 0 -22px; }

.listing-content-left, .listing-content-right { width: 50%; flex: 0 0 50%; padding: 0 22px; }

.listing-content-left-c, .listing-content-right-c { display: flex; flex-wrap: wrap; margin: 0 -8px; }

.listing-content-left-c .listing-item-wrapper, .listing-content-right-c .listing-item-wrapper {
    width: 100%;
    flex: 0 0 100%;
    padding: 0 8px;
    margin-bottom: 12px;
}

.listing-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--speed) var(--ease);
}

.listing-item:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--accent-rgb), .45);
    box-shadow: var(--accent-glow);
}

.listing-item-left { flex: 0 0 72px; position: relative; }

.listing-item-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    transition: transform var(--speed) var(--ease);
}

.listing-item:hover .listing-item-img { transform: scale(1.06); }

.listing-item-right { flex: 1 1 auto; min-width: 0; padding-left: 15px; display: flex; align-items: center; }

.listing-item-right-l { flex: 1 1 auto; min-width: 0; padding-right: 10px; }

.listing-item-name {
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-item-meta-w {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    flex-wrap: wrap;
}

.listing-item-meta-col { position: relative; padding-right: 12px; margin-right: 6px; }
.listing-item-meta-col:after {
    content: '';
    height: 16px;
    width: 1px;
    right: 0;
    top: calc(50% - 8px);
    position: absolute;
    background: var(--border-strong);
}
.listing-item-meta-col:last-child::after { display: none; }

.listing-item-meta-col-c { display: flex; align-items: center; }

.listing-item-meta-icon { width: 16px; margin-right: 4px; }

.listing-item-meta-label {
    font-size: .72rem;
    font-weight: 500;
    color: var(--muted);
    margin-right: 5px;
    line-height: 1;
}

.listing-item-meta-val {
    font-size: .86rem;
    font-weight: 700;
    line-height: 1;
}

.listing-item-right-r { flex: 0 0 34px; }

.listing-item-d-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .6));
    color: #fff;
    box-shadow: var(--accent-glow);
    transition: all var(--speed) var(--ease);
}

.listing-item:hover .listing-item-d-btn {
    transform: translateX(3px) scale(1.08);
    box-shadow: 0 12px 28px rgba(var(--accent-rgb), .5);
}

.listing-item-d-btn-icon { width: 20px; filter: invert(1); }

/* ------------------------------------------------------------
   Grid cards (view-all / search results)
------------------------------------------------------------ */
.l-c-gcs { display: flex; flex-wrap: wrap; margin: 0 -10px; align-content: flex-start; }

.l-c-gcs .listing-item-wrapper {
    width: 25%;
    flex: 0 0 25%;
    padding: 0 10px;
    margin-bottom: 16px;
}

.l-c-gcs .listing-item {
    display: block;
    padding: 22px 20px 18px;
    text-align: center;
}

.l-c-gcs .listing-item .listing-item-left, .l-c-gcs .listing-item .listing-item-right { float: none; width: 100%; padding: 0; }
.l-c-gcs .listing-item .listing-item-left { text-align: center; flex: none; }

.l-c-gcs .listing-item .listing-item-img {
    width: 96px;
    height: 96px;
    border-radius: 24px;
}

.l-c-gcs .listing-item .listing-item-right { display: block; }

.l-c-gcs .listing-item .listing-item-right-l { width: 100%; padding: 0; }

.l-c-gcs .listing-item .listing-item-name-w { margin-top: 14px; }

.l-c-gcs .listing-item .listing-item-name {
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    height: 2.6em;
}

.l-c-gcs .listing-item .listing-item-meta-w { justify-content: center; margin-top: 12px; gap: 4px; }
.l-c-gcs .listing-item .listing-item-meta-col { margin: 0; padding: 0 10px; }
.l-c-gcs .listing-item .listing-item-meta-col:after { display: none; }
.l-c-gcs .listing-item .listing-item-meta-col-c { flex-direction: column; }
.l-c-gcs .listing-item .listing-item-meta-icon { margin: 0 0 4px; }

.l-c-gcs .listing-item .listing-item-right-r { display: none; }

.listing-item-badge-w {
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .05em;
    border-radius: 50px;
    min-width: 46px;
    height: 20px;
    margin: -30px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-transform: uppercase;
    box-shadow: var(--accent-glow);
    position: relative;
    z-index: 3;
    background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .6));
}

/* ------------------------------------------------------------
   Search results
------------------------------------------------------------ */
.search-results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

#close-search {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .6));
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--accent-glow);
    transition: all var(--speed) var(--ease);
}

#close-search:hover { transform: rotate(90deg) scale(1.08); }

.close-search-icon { width: 18px; filter: invert(1); }

.search-results-title { font-size: 1.05rem; font-weight: 500; color: var(--muted); }
#search-query { color: var(--text); font-weight: 700; }

.empty-content { color: var(--muted); font-size: 1.1rem; font-weight: 600; text-align: center; width: 100%; padding: 40px 0; }

/* ------------------------------------------------------------
   App detail view
------------------------------------------------------------ */
.appdet-container { overflow: auto; z-index: 1; max-width: 100%; height: 100%; }

.appdet-container-bg { height: 32vh; position: absolute; top: 0; left: 0; width: 100%; background-size: cover !important; background-position: center !important; }

.appdet-container-bg.bg-blur::after {
    content: "";
    position: absolute;
    inset: 0;
    backdrop-filter: blur(14px);
    background: rgba(4, 8, 20, .35);
}

.appdet-container-content { margin: 0 auto; position: relative; padding-top: 26vh; }

.appdet-container-content-inner {
    padding: 34px 44px 44px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    position: relative;
    z-index: 2;
    border: 1px solid var(--border);
    border-bottom: none;
}

.appdet-exit {
    position: absolute;
    right: 18px;
    top: 18px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .6));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--accent-glow);
    transition: all var(--speed) var(--ease);
}

.appdet-exit:hover { transform: rotate(90deg) scale(1.1); }

.appdet-close-icon { width: 20px; filter: invert(1); }

.appdet-c-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px; }

.appdet-c-top-l { flex: 0 0 150px; margin-top: -120px; }

.appdet-icon {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 34px;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--surface);
    background: var(--surface-2);
}

.appdet-c-top-r { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.appdet-c-top-r-l { min-width: 0; }

.appdet-badge-w { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.appdet-badge-b {
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .05em;
    border-radius: 50px;
    padding: 4px 12px;
    color: var(--accent);
    background: var(--accent-soft);
    text-transform: uppercase;
    border: none;
    display: inline-block;
}

.appdet-name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.appdet-t-btn {
    flex: 0 0 auto;
    padding: 0 28px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .55));
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    box-shadow: var(--accent-glow);
    transition: all var(--speed) var(--ease);
}

.appdet-t-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(var(--accent-rgb), .5);
}

.appdet-t-btn-icon { width: 20px; filter: invert(1); }

.appdet-c-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 26px 0 22px;
    padding: 18px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.appdet-c-meta-col { flex: 1 1 15%; min-width: 130px; position: relative; }

.appdet-c-meta-col-c { display: flex; flex-direction: column; align-items: center; text-align: center; }

.appdet-meta-icon { width: 20px; margin-bottom: 6px; opacity: .9; }

.appdet-c-meta-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: 4px;
}

.appdet-c-meta-val { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.appdet-c-bottom { margin-top: 8px; }

.appdet-description { font-size: .95rem; line-height: 1.7; color: var(--text); }

.appdet-description h2 { font-size: 1.4rem; margin: 22px 0 10px; }
.appdet-description h3 { font-size: 1.2rem; margin: 20px 0 8px; }
.appdet-description h4 { font-size: 1.05rem; margin: 18px 0 6px; }
.appdet-description a { color: var(--accent); }

.appdet-description ol, .appdet-description ul { list-style-type: none; padding-left: 8px; }
.appdet-description ol li, .appdet-description ul li { position: relative; padding: 6px 0 6px 28px; }

.appdet-description ol li:before,
.appdet-description ul li:before {
    content: counter(li);
    counter-increment: li;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    top: calc(50% - 11px);
    font-size: .75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .55));
    color: #fff;
}

.appdet-description ul li:before { content: ''; background: var(--accent); }

/* ------------------------------------------------------------
   Processing / download modal
------------------------------------------------------------ */
#proccessing-outer-wrapper {
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    position: fixed;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 8, 20, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.proccessing-wrapper {
    width: 460px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.proccessing-header { padding: 16px 22px; background: var(--surface-2); border-bottom: 1px solid var(--border); }

.proccessing-content { padding: 26px 46px 40px; text-align: center; }

.proccessing-title {
    font-family: var(--font-display);
    font-size: .95rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 40px;
    text-align: center;
}

.proccessing-msg { font-size: 1.15rem; font-weight: 600; color: var(--text); margin-top: 24px; text-align: center; }

.loadp-w { position: relative; width: 240px; height: 240px; border-radius: 50%; display: block; margin: 10px auto 0; }

.loadp-w .loadp-spin {
    position: absolute;
    animation: rotateit 3s linear infinite;
    display: block;
    width: 240px;
    height: 240px;
}

.loadp-w .loadp-spin .loadp-bg-fix { width: 240px; height: 240px; display: block; position: absolute; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); }

.loadp-w .loadp-spin .gauge {
    position: absolute;
    width: 240px;
    height: 120px;
    top: -1px;
    left: 0;
    border-radius: 120px 120px 0 0;
    border: 3px solid var(--accent);
    border-bottom: none;
}

.loadp-w .loadp-spin .loadp-spin-circle {
    position: absolute;
    z-index: 4;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    right: -6px;
    top: 120px;
    background: var(--accent);
    box-shadow: 0 0 18px 2px var(--accent);
}

.loadp-w .p-title { text-align: center; font-size: 15px; font-weight: 500; opacity: .8; color: var(--muted); }
.loadp-w .p-percentage { z-index: 3; font-size: 52px; width: 100%; display: block; text-align: center; font-weight: 300; color: var(--text); position: relative; }
.loadp-w .p-size { text-align: center; font-size: 15px; font-weight: 500; opacity: .7; color: var(--muted); }

.p-content { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; }

.proccessing-loadbar { height: 6px; margin-top: 18px; border-radius: 50px; background: var(--surface-3); overflow: hidden; }
.proccessing-loadbar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), .6)); border-radius: 50px; transition: width .15s linear; }

#s-p-c-title { color: var(--accent); text-align: center; font-weight: 700; font-size: 1.2rem; margin: 0 auto 6px; }
#s-p-c-msg { font-size: 1rem; text-align: center; color: var(--muted); }

.cloned-appdet-c-top-p .appdet-t-btn { display: none; }
.cloned-appdet-c-top-p .appdet-icon { border-radius: 14px; width: 46px; height: 46px; }
.cloned-appdet-c-top-p .appdet-c-top-l { flex: 0 0 46px; margin: 0; }
.cloned-appdet-c-top-p .appdet-name { font-size: 1rem; }
.cloned-appdet-c-top-p .appdet-badge-b { font-size: .6em; padding: 2px 8px; }

/* ------------------------------------------------------------
   Footer
------------------------------------------------------------ */
footer {
    position: relative;
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    font-size: .8rem;
    color: var(--muted);
}

footer p { margin: 0 auto; max-width: 700px; line-height: 1.6; }

/* ------------------------------------------------------------
   Preloader
------------------------------------------------------------ */
.preloader-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: var(--bg);
}

.ball-scale-multiple { position: relative; }
.ball-scale-multiple>div {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    margin: 0;
    border-radius: 100%;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), .5));
    -webkit-animation: ball-scale-multiple 1s 0s linear infinite;
    animation: ball-scale-multiple 1s 0s linear infinite;
}

/* ------------------------------------------------------------
   Desktop notice page (i-nd.php)
------------------------------------------------------------ */
.page-body-desktop .page-header {
    text-align: center;
    padding: 46px 20px 0;
    background: var(--bg);
}

.page-body-desktop .page-header .container { position: relative; z-index: 2; }

.page-body-desktop .logo-wrapper {
    margin: 0 auto 18px;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), .9), rgba(var(--accent-rgb), .45));
    box-shadow: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.page-body-desktop .header-logo-img { max-width: 100%; max-height: 44px; }

.page-body-desktop .header-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    background: linear-gradient(90deg, var(--text) 40%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-body-desktop .header-subtitle { color: var(--muted); margin-top: 6px; }

.access-notice-section {
    position: relative;
    min-height: 70vh;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.access-notice-wrapper {
    max-width: 520px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-md);
}

.access-notice-icon { width: 120px; margin-bottom: 20px; opacity: .9; }

.access-notice-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--accent);
}

.access-notice-wrapper p { color: var(--muted); line-height: 1.6; margin: 0; }

.d-b-section { display: none; }

/* ------------------------------------------------------------
   Responsive
------------------------------------------------------------ */
@media (max-width: 1024px) {
    .l-c-gcs .listing-item-wrapper { width: 33.333%; flex: 0 0 33.333%; }
}

@media (max-width: 768px) {
    .l-c-gcs .listing-item-wrapper { width: 50%; flex: 0 0 50%; }
}

/* Mobile-app wrapper (.madpt) */
@media (max-width: 991px) {
    .ar-wa-s { padding: 0; }
    .ar-wa-w { border-radius: 0; border-left: none; border-right: none; }

    .ar-wa-f-l-w, .ar-wa-f-r-w { width: 100%; flex: 0 0 100%; }

    .ar-wa-f-l-w {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 444;
        background: var(--surface);
        background: color-mix(in srgb, var(--surface) 88%, transparent);
        backdrop-filter: blur(20px) saturate(1.4);
        -webkit-backdrop-filter: blur(20px) saturate(1.4);
        border-top: 1px solid var(--border);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, .25);
    }

    .ar-wa-f-l-w .ar-wa-view-nav { padding: 10px 14px; }
    .ar-wa-f-l-w .ar-wa-view-nav ul { display: flex; gap: 6px; flex-direction: row; }
    .ar-wa-f-l-w .ar-wa-view-nav ul li { width: 33.333%; flex: 0 0 33.333%; }

    .ar-wa-view-nav-item { justify-content: center; padding: 11px 8px; border-radius: 14px; }
    .ar-wa-view-nav-item:hover { transform: none; }
    .ar-wa-view-nav-item.ar-wa-view-nav-item-active { transform: none; }
    .ar-wa-nav-icon { margin-right: 6px; }

    .ar-wa-games, .ar-wa-apps, .ar-wa-discover, .ar-wa-search { padding: 22px 16px 90px; }

    .listing-content { display: block; margin: 0; }
    .listing-content-left, .listing-content-right { width: 100%; flex: 0 0 100%; padding: 0; }

    .listing-content-left, .featured-section, .trending-section { margin-bottom: 24px; }

    .madpt .ar-wa-header { position: fixed; top: 0; width: 100%; z-index: 999; height: 76px; padding: 8px 14px; }
    .madpt .ar-wa-header.sticky-header { height: 76px; }
    .madpt .ar-wa-f-r-w { margin-top: 76px; padding-top: 6px; }

    .madpt .ar-wa-header-content-l { width: auto; }
    .madpt .ar-wa-header-title { font-size: 1.05rem; display: block; }
    .madpt .logo-wrapper { width: 40px; height: 40px; border-radius: 13px; }
    .madpt .header-logo-img { max-height: 30px; }

    .madpt .ar-wa-header-content-r { justify-content: flex-end; gap: 8px; }
    .madpt .search-form-wrapper { margin: 0; max-width: 60%; }
    .madpt .search-input { min-width: 0; height: 40px; padding-left: 44px; font-size: .85rem; }
    .madpt .search-input-wrapper .search-icon { width: 17px; top: 11px; left: 15px; }
    .madpt .color-mode-btn { width: 40px; height: 40px; border-radius: 12px; }

    .madpt .featured-app-slider-item { height: 200px; }
    .madpt .featured-app-c-l { flex: 0 0 76px; }
    .madpt .featured-app-slider-item-img { max-width: 100%; border-radius: 16px; }
    .madpt .featured-app-c-r { padding-left: 12px; }
    .madpt .featured-app-slider-item-name { font-size: 1.05rem; }
    .madpt .featured-app-d { font-size: .82rem; }

    .madpt .trending-app-item { width: 120px; flex: 0 0 120px; }

    .madpt .appdet-c-top { gap: 14px; }
    .madpt .appdet-c-top-l { flex: 0 0 96px; margin-top: -90px; }
    .madpt .appdet-icon { width: 96px; height: 96px; border-radius: 24px; }
    .madpt .appdet-name { font-size: 1.3rem; }
    .madpt .appdet-t-btn { height: 46px; padding: 0 18px; }
    .madpt .appdet-container-content-inner { padding: 26px 18px 40px; }
    .madpt .appdet-c-meta { flex-wrap: nowrap; overflow-x: auto; }
    .madpt .appdet-c-meta-col { min-width: 110px; flex: 0 0 110px; }

    .madpt .proccessing-wrapper { width: 100%; border-radius: 24px 24px 0 0; }
    .madpt #proccessing-outer-wrapper { align-items: flex-end; }
    .madpt .proccessing-content { padding: 22px 20px 34px; }

    .madpt .ar-wa-s { padding-bottom: 90px; }
}

@media (max-width: 420px) {
    .l-c-gcs .listing-item-wrapper { width: 100%; flex: 0 0 100%; }
    .madpt .search-form-wrapper { max-width: 55%; }
    .madpt .featured-app-slider-item { height: 180px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   THEME AUTHORITY OVERRIDES
   Re-assert the modern palette over dm.css / lm.css rules that
   use higher-specificity .cm-d / .cm-l prefixed selectors.
   ============================================================ */
.cm-d .ar-wa-s, .cm-l .ar-wa-s {
    background:
        radial-gradient(1100px 500px at 8% -10%, rgba(var(--accent-rgb), .16), transparent 60%),
        radial-gradient(900px 480px at 100% 0%, rgba(var(--accent-rgb), .10), transparent 55%),
        var(--bg);
}

.cm-d .ar-wa-w, .cm-l .ar-wa-w { background: var(--bg-soft); }
.cm-d .ar-wa-f-r-w, .cm-l .ar-wa-f-r-w { background: var(--bg-soft); }

.cm-d .ar-wa-header, .cm-l .ar-wa-header {
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.cm-d .ar-wa-header.sticky-header, .cm-l .ar-wa-header.sticky-header {
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.cm-d .preloader-wrapper, .cm-l .preloader-wrapper { background: var(--bg); }

.cm-d .search-input, .cm-l .search-input { background: var(--surface-2); color: var(--text); }
.cm-d .search-input::placeholder, .cm-l .search-input::placeholder { color: var(--muted); opacity: 1; }

.cm-d .listing-item, .cm-l .listing-item { background: var(--surface); }
.cm-d .proccessing-wrapper, .cm-l .proccessing-wrapper { background: var(--surface); }
.cm-d .sticky-app-top, .cm-l .sticky-app-top { background: var(--surface); }

.madpt .ar-wa-f-l-w {
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

/* Nav text colours — keep active item readable on the accent pill */
.cm-d .ar-wa-view-nav-item span, .cm-l .ar-wa-view-nav-item span { color: inherit; }
.cm-d .ar-wa-view-nav-item.ar-wa-view-nav-item-active span,
.cm-l .ar-wa-view-nav-item.ar-wa-view-nav-item-active span { color: #fff; }

.cm-d footer, .cm-l footer { color: var(--muted); background: var(--surface); }

.cm-d .search-results-header, .cm-l .search-results-header { color: var(--muted); }
