/* ==========================================================
   D-LUFFY — SPACE GUARDIAN THEME
   مشهد فضائي بنفسجي + أجسام عائمة مرتبطة بالبوت + بوابة تسجيل الدخول
   ========================================================== */
:root {
    --bg-deep: #0a0620;
    --bg-mid: #1b0f4d;
    --bg-glow: #4a2bb8;

    --primary: #5865F2;
    --primary-light: #8a93ff;
    --primary-glow: rgba(88, 101, 242, 0.45);
    --lime: #b6f542;
    --lime-glow: rgba(182, 245, 66, 0.45);

    --text-main: #f4f3ff;
    --text-muted: #a9a4d6;
    --glass: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.14);

    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg-deep);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    transition: opacity 0.3s var(--ease-spring);
}
body.page-loaded { opacity: 1; }
body.page-exiting { opacity: 0; transition: opacity 0.2s ease; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* شريط التقدم */
#page-progress-bar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg, #5865F2, #a855f7, #b6f542);
    box-shadow: 0 0 14px var(--primary-glow);
    z-index: 99999; transition: width 0.3s ease; pointer-events: none;
}

/* ---------- Navbar ---------- */
.navbar {
    height: 68px; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: linear-gradient(180deg, rgba(10, 6, 32, 0.75), rgba(10, 6, 32, 0));
}
@media (min-width: 901px) {
    .navbar {
        height: 68px !important;
        padding: 0 24px !important;
    }
}
.nav-left { display: flex; align-items: center; gap: 32px; }
.brand-logo {
    display: inline-flex; align-items: center; gap: 11px; text-decoration: none;
    color: #ffffff; font-weight: 800; font-size: 16.5px; letter-spacing: -0.3px;
    background: transparent; border: none; padding: 0;
    transform: none; transition: none;
}
.brand-logo:hover {
    color: #ffffff; background: transparent; border: none; transform: none;
}
.brand-logo img {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 2px solid rgba(138, 147, 255, 0.55);
    box-shadow: 0 0 12px rgba(88, 101, 242, 0.35);
    transform: none; transition: none;
}
.brand-logo:hover img { transform: none; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
    color: var(--text-muted); text-decoration: none; font-size: 13.5px; font-weight: 600;
    padding: 8px 14px; border-radius: 99px; transition: all 0.2s var(--ease-spring);
}
.nav-link:hover { color: #fff; background: var(--glass); }

.nav-link.nav-premium-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fbbf24; font-weight: 700; font-size: 13px; padding: 7px 16px;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.15);
    transition: all 0.28s var(--ease-bounce);
}
.nav-link.nav-premium-btn:hover {
    background: linear-gradient(135deg, #fbbf24, #d97706); color: #0a0620;
    transform: translateY(-2px) scale(1.03); box-shadow: 0 6px 20px rgba(251, 191, 36, 0.45);
}

/* زر Login (أبيض مثل Request a demo في الفيديو) */
.btn-login {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; color: #120a35; padding: 9px 20px; border-radius: 99px;
    font-size: 13.5px; font-weight: 700; text-decoration: none;
    transition: all 0.25s var(--ease-spring);
}
.btn-login:hover { background: var(--primary); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px var(--primary-glow); }

/* ---------- User dropdown ---------- */
.user-menu-container { position: relative; }
.user-avatar-btn {
    display: flex; align-items: center; gap: 8px; background: var(--glass);
    border: 1px solid var(--glass-border); border-radius: 99px; padding: 4px 12px 4px 4px;
    cursor: pointer; color: #fff; transition: background 0.2s;
}
.user-avatar-btn:hover { background: rgba(255, 255, 255, 0.12); }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.dropdown-arrow { font-size: 10px; transition: transform 0.25s var(--ease-spring); }
.user-menu-container.open .dropdown-arrow,
.user-menu-container:hover .dropdown-arrow { transform: rotate(180deg); }

.user-dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; padding: 8px;
    background: rgba(18, 10, 53, 0.96); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98);
    transition: all 0.22s var(--ease-spring);
}
.user-menu-container.open .user-dropdown-menu,
.user-menu-container:hover .user-dropdown-menu,
.user-menu-container:focus-within .user-dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
    color: #d9d6ff; text-decoration: none; font-size: 13.5px; font-weight: 600; transition: background 0.15s;
}
.dropdown-item i { width: 16px; text-align: center; color: var(--primary-light); }
.dropdown-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.dropdown-divider { height: 1px; background: var(--glass-border); margin: 6px 4px; }
.dropdown-section-title { padding: 6px 12px 2px; font-size: 12px; color: var(--text-muted); font-weight: 700; }
.logout-item, .logout-item i { color: #ff6b81; }
.logout-item:hover { background: rgba(255, 107, 129, 0.12); }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden; min-height: 100vh;
    display: flex; align-items: center; justify-content: center; text-align: center;
    background:
        radial-gradient(ellipse 60% 50% at 50% 42%, rgba(120, 80, 255, 0.55) 0%, transparent 70%),
        radial-gradient(ellipse 80% 60% at 20% 100%, rgba(74, 43, 184, 0.7) 0%, transparent 70%),
        linear-gradient(180deg, #0a0620 0%, #1b0f4d 55%, #2a1680 100%);
}

.rocks { position: absolute; left: -3%; width: 106%; z-index: 2; pointer-events: none; will-change: transform; }
.rocks-back { bottom: 0; height: 80%; opacity: 0.9; z-index: 0; }
.rocks-front { bottom: -2%; height: 38%; }

/* العناصر العائمة: الـ outer يتحرك مع الماوس، والـ inner يطفو لوحده */
.float { position: absolute; left: var(--x); top: var(--y); z-index: 1; will-change: transform; }
.drift { animation: drift 9s ease-in-out infinite; }
.drift.d2 { animation-duration: 11s; animation-delay: -3s; }
.drift.d3 { animation-duration: 13s; animation-delay: -6s; }
.drift.d4 { animation-duration: 10s; animation-delay: -2s; animation-direction: reverse; }
.drift.d5 { animation-duration: 8s; animation-delay: -5s; }
@keyframes drift {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg); }
    50% { transform: translate3d(8px, -22px, 0) rotate(5deg); }
}

.chip {
    display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px;
    background: linear-gradient(145deg, rgba(160, 150, 255, 0.35), rgba(88, 101, 242, 0.12));
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 14px 34px rgba(8, 4, 40, 0.55), 0 0 28px var(--primary-glow);
    backdrop-filter: blur(6px); color: #e7e5ff; font-size: 24px;
}
.chip.big { width: 88px; height: 88px; border-radius: 28px; font-size: 36px; }
.chip.small { width: 44px; height: 44px; border-radius: 14px; font-size: 17px; opacity: 0.9; }
.chip.gold { color: #fbbf24; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 14px 34px rgba(8, 4, 40, 0.55), 0 0 28px rgba(251, 191, 36, 0.35); }

.gem {
    display: grid; place-items: center; width: 78px; height: 84px; font-size: 26px; color: #2c4a00;
    background: linear-gradient(150deg, #e6ffa8 0%, #b6f542 55%, #7fc418 100%);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    filter: drop-shadow(0 0 18px var(--lime-glow));
}

.shard { display: block; width: 9px; height: 34px; border-radius: 3px; transform: rotate(32deg); animation: drift 7s ease-in-out infinite; }
.s-pink { background: #ff8fd0; box-shadow: 0 0 12px rgba(255, 143, 208, 0.6); }
.s-lilac { background: #c9bfff; width: 7px; height: 22px; box-shadow: 0 0 12px rgba(201, 191, 255, 0.6); animation-duration: 9s; }
.s-lime { background: var(--lime); width: 8px; height: 26px; box-shadow: 0 0 12px var(--lime-glow); animation-duration: 8s; }

/* اللوغو مكان رائد الفضاء */
.hero-logo {
    position: absolute; inset: 0; margin: auto; z-index: 1;
    width: min(46vw, 500px); height: min(46vw, 500px); will-change: transform;
}
.hero-logo img {
    width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen;
    -webkit-mask-image: radial-gradient(circle, #000 50%, transparent 70%);
    mask-image: radial-gradient(circle, #000 50%, transparent 70%);
    animation: bob 7s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-18px) rotate(2deg); } }
.logo-ring {
    position: absolute; inset: 14%; border-radius: 50%; border: 2px solid transparent;
    border-top-color: var(--lime); border-right-color: rgba(182, 245, 66, 0.25);
    animation: spin 8s linear infinite; z-index: 2;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-content { position: relative; z-index: 3; padding: 110px 24px 90px; max-width: 920px; }
.hero-title {
    font-size: clamp(38px, 6.6vw, 82px); font-weight: 800; line-height: 1.04; letter-spacing: -0.04em;
    text-shadow: 0 4px 40px rgba(10, 6, 32, 0.75);
}
.hero-title .w { display: inline-block; opacity: 0; transform: translateY(26px); filter: blur(10px); }
body.page-loaded .hero-title .w { animation: wordIn 0.9s var(--ease-spring) forwards; animation-delay: calc(var(--i, 0) * 110ms + 150ms); }
@keyframes wordIn { to { opacity: 1; transform: none; filter: blur(0); } }

.hero-desc {
    max-width: 560px; margin: 22px auto 0; font-size: 16.5px; line-height: 1.65;
    color: var(--text-muted); text-shadow: 0 2px 20px rgba(10, 6, 32, 0.9);
}
.hero-actions { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* زر CTA: داكن ثم ينقلب إلى أبيض عند الـ hover (مثل Begin Your Mission) */
.btn-add-discord {
    display: inline-flex; align-items: center; gap: 14px; padding: 8px 8px 8px 24px; border-radius: 99px;
    background: #0a0620; color: #fff; text-decoration: none; font-weight: 700; font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.12); transition: all 0.3s var(--ease-spring);
}
.btn-add-discord i {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: #fff; color: #0a0620; font-size: 14px; transition: all 0.3s var(--ease-spring);
}
.btn-add-discord:hover { background: #fff; color: #0a0620; transform: translateY(-3px); box-shadow: 0 14px 40px rgba(255, 255, 255, 0.25); }
.btn-add-discord:hover i { background: #0a0620; color: #fff; transform: translateX(3px); }

.btn-browse, .btn-hero-dashboard {
    display: inline-flex; align-items: center; gap: 9px; padding: 0 26px; height: 52px; border-radius: 99px;
    background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(8px);
    color: #fff; text-decoration: none; font-weight: 700; font-size: 15px; transition: all 0.25s var(--ease-spring);
}
.btn-browse:hover, .btn-hero-dashboard:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-3px); }

/* ---------- Features ---------- */
.features {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    max-width: 1180px; width: 100%; margin: 0 auto; padding: 90px 40px;
}
.feature { padding: 4px 28px; border-left: 1px solid var(--glass-border); }
.feature:first-child { border-left: none; padding-left: 0; }
.feature i { font-size: 22px; color: var(--primary-light); margin-bottom: 16px; display: block; }
.feature h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature p { font-size: 14px; line-height: 1.6; color: var(--text-muted); }

/* ---------- Footer ---------- */
.footer {
    margin-top: auto; padding: 24px 40px; display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--glass-border);
}

/* ---------- Portal (Login animation) ---------- */
#portal {
    position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 34px; pointer-events: none;
    background: radial-gradient(circle at 50% 45%, #4a2bb8 0%, #1b0f4d 45%, #0a0620 100%);
    clip-path: circle(0px at var(--px, 90%) var(--py, 5%));
    transition: clip-path 0.75s cubic-bezier(0.7, 0, 0.2, 1);
}
#portal.open { clip-path: circle(150vmax at var(--px, 90%) var(--py, 5%)); pointer-events: all; }

.portal-core { position: relative; width: 190px; height: 190px; display: grid; place-items: center; }
.portal-core img {
    width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen; border-radius: 50%;
    -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 72%);
    mask-image: radial-gradient(circle, #000 52%, transparent 72%);
    transform: scale(0.4); opacity: 0;
}
#portal.open .portal-core img { animation: logoIn 0.9s 0.35s var(--ease-bounce) forwards; }
@keyframes logoIn { to { transform: scale(1); opacity: 1; } }

.portal-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--lime); opacity: 0; }
#portal.open .portal-ring { animation: ringOut 1.8s ease-out infinite; }
#portal.open .r2 { animation-delay: 0.6s; border-color: var(--primary-light); }
#portal.open .r3 { animation-delay: 1.2s; }
@keyframes ringOut { 0% { transform: scale(0.7); opacity: 0.9; } 100% { transform: scale(2.6); opacity: 0; } }

.portal-text { font-size: 15px; font-weight: 600; color: #d9d6ff; min-height: 22px; letter-spacing: 0.01em; }
.portal-text::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 4px; background: var(--lime); vertical-align: -2px; animation: blink 0.8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .navbar { padding: 0 18px; }
    .nav-links .nav-link:not(.nav-premium-btn) { display: none; }
    .features { grid-template-columns: 1fr 1fr; gap: 36px 0; padding: 60px 24px; }
    .feature:nth-child(odd) { border-left: none; padding-left: 0; }
    .float:nth-of-type(n+7) { display: none; }
    .hero-logo { width: 78vw; height: 78vw; opacity: 0.8; }
    .footer { flex-direction: column; gap: 12px; }
}
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } .feature { border-left: none; padding-left: 0; } }

@media (prefers-reduced-motion: reduce) {
    .drift, .shard, .hero-logo img, .logo-ring { animation: none !important; }
    .hero-title .w { opacity: 1; transform: none; filter: none; animation: none !important; }
}

/* Commands Navbar Link & Count Pill */
.nav-link.nav-commands-link {
    display: inline-flex; align-items: center; gap: 7px;
}
.nav-link.nav-commands-link i {
    font-size: 12px; color: var(--primary-light);
}
.nav-cmd-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1.5px 7px; border-radius: 99px;
    background: rgba(182, 245, 66, 0.14);
    border: 1px solid rgba(182, 245, 66, 0.35);
    color: var(--lime); font-size: 11px; font-weight: 800; line-height: 1.3;
}
.nav-link.active {
    color: #fff; background: rgba(138, 147, 255, 0.16);
    border: 1px solid rgba(138, 147, 255, 0.32);
}

/* Unified Premium "SOON" pill & Active Gold state across ALL public tabs */
.nav-soon-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.5px 7px;
    border-radius: 99px;
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.48);
    color: #fde68a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.3;
    transition: all 0.2s ease;
}
.nav-soon-pill.is-inline {
    margin-left: auto;
    font-size: 9.5px;
    padding: 1.5px 6px;
}
.idx-md-link .nav-soon-pill {
    margin-left: auto;
}
.nav-link.nav-premium-btn.active {
    color: #fde68a;
    background: rgba(251, 191, 36, 0.22);
    border: 1px solid rgba(251, 191, 36, 0.72);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}
.nav-link.nav-premium-btn:hover .nav-soon-pill {
    background: rgba(10, 6, 32, 0.2);
    border-color: rgba(10, 6, 32, 0.35);
    color: #0a0620;
}
@media (max-width: 900px) {
    .nav-links .nav-link.nav-commands-link { display: inline-flex; padding: 7px 12px; font-size: 12.5px; }
}


/* Active Footer Link Highlight across all public pages */
.footer .nav-link.active-foot {
    color: var(--lime);
    font-weight: 700;
}


/* ==========================================================
   PUBLIC PAGES & INDEX.PHP — MOBILE & TABLET PRO RESPONSIVE
   Zero visual change on Desktop (> 900px)
========================================================== */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.idx-mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid rgba(190, 180, 255, 0.22);
    background: rgba(122, 108, 255, 0.14);
    color: #ffffff;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.idx-mobile-menu-btn:hover,
.idx-mobile-menu-btn[aria-expanded="true"] {
    background: rgba(182, 245, 66, 0.18);
    border-color: rgba(182, 245, 66, 0.55);
    color: var(--lime);
}

.idx-mobile-backdrop {
    display: block;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    inset: 0;
    top: 60px;
    background: rgba(6, 3, 22, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

.idx-mobile-backdrop.open {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

.idx-mobile-drawer {
    display: none;
    position: fixed;
    top: 60px;
    left: 12px;
    right: 12px;
    z-index: 99;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(165deg, rgba(28, 17, 82, 0.98) 0%, rgba(11, 7, 36, 0.99) 100%);
    border: 1px solid rgba(190, 180, 255, 0.22);
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.8), 0 0 32px rgba(106, 99, 247, 0.24);
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.22s var(--ease-spring), transform 0.24s var(--ease-spring);
}

.idx-mobile-drawer.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.idx-md-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.idx-md-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: #dedbff;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.idx-md-link > i:first-child {
    width: 22px;
    text-align: center;
    color: var(--primary-light);
    font-size: 15px;
}

.idx-md-link .nav-cmd-badge,
.idx-md-ext {
    margin-left: auto;
}

.idx-md-ext {
    font-size: 11px;
    color: var(--text-muted);
}

.idx-md-link.is-active,
.idx-md-link:hover {
    background: rgba(122, 108, 255, 0.2);
    border-color: rgba(163, 157, 255, 0.35);
    color: #ffffff;
}

.idx-md-link.is-premium {
    color: #fde68a;
    background: rgba(251, 191, 36, 0.09);
    border-color: rgba(251, 191, 36, 0.28);
}

.idx-md-link.is-premium > i:first-child {
    color: #fbbf24;
}

.idx-md-divider {
    height: 1px;
    background: rgba(190, 180, 255, 0.14);
    margin: 12px 2px;
}

.idx-md-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.idx-md-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.16s ease, filter 0.16s ease;
}

.idx-md-cta.primary {
    background: var(--lime);
    color: #0a0620;
    box-shadow: 0 8px 22px rgba(182, 245, 66, 0.28);
}

.idx-md-cta.ghost {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(190, 180, 255, 0.2);
    color: #ffffff;
}

.idx-md-cta.danger {
    background: rgba(255, 107, 129, 0.14);
    border: 1px solid rgba(255, 107, 129, 0.32);
    color: #ff8da0;
}

body.idx-mob-nav-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .navbar {
        height: 60px;
        padding: 0 14px;
        gap: 10px;
        background: rgba(10, 6, 32, 0.86);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(190, 180, 255, 0.1);
    }

    .nav-left {
        gap: 12px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .brand-logo {
        font-size: 15.5px;
        gap: 9px;
        min-width: 0;
    }

    .brand-logo img {
        width: 32px;
        height: 32px;
    }

    .brand-logo span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 155px;
    }

    /* Show mobile menu button & drawer on index.php */
    .idx-mobile-menu-btn {
        display: inline-flex;
    }
    .idx-mobile-drawer {
        display: block;
    }

    /* On index.php (where mobile drawer exists), hide cramped inline nav links cleanly */
    .navbar:has(#idxMobileMenuBtn) .nav-links {
        display: none !important;
    }

    /* On other public pages (commands/docs/terms/privacy), keep nav compact & non-overflowing */
    .nav-links {
        gap: 6px;
    }
    .nav-links .nav-link.nav-premium-btn {
        padding: 6px 11px;
        font-size: 12px;
    }
    .nav-links .nav-link.nav-commands-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    .btn-login {
        padding: 8px 14px;
        font-size: 12.5px;
        white-space: nowrap;
    }

    .user-dropdown-menu {
        max-width: calc(100vw - 24px);
    }

    /* Hero section mobile polish — clear text & non-overlapping ambient chips */
    .hero {
        min-height: 100dvh;
    }

    .hero-content {
        padding: 96px 20px 80px;
        max-width: 100%;
    }

    .hero-logo {
        width: min(74vw, 360px);
        height: min(74vw, 360px);
        opacity: 0.48;
    }

    /* Keep only outer corner chips softly framed around hero, never blocking text */
    .float:nth-of-type(n+5) {
        display: none;
    }
    .float .chip {
        width: 46px;
        height: 46px;
        border-radius: 15px;
        font-size: 18px;
        opacity: 0.58;
    }
    .float .chip.big {
        width: 54px;
        height: 54px;
        border-radius: 18px;
        font-size: 22px;
        opacity: 0.58;
    }
    .float:nth-of-type(1) { --x: 6% !important;  --y: 13% !important; }
    .float:nth-of-type(2) { --x: 80% !important; --y: 14% !important; }
    .float:nth-of-type(3) { --x: 80% !important; --y: 78% !important; }
    .float:nth-of-type(4) { --x: 6% !important;  --y: 77% !important; }

    /* Footer wrap fix across ALL public pages (overrides inline flex nowrap) */
    .footer {
        flex-direction: column;
        gap: 14px;
        padding: 22px 18px 28px;
        text-align: center;
    }

    .footer > div:last-child {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px 14px !important;
        width: 100%;
    }

    .footer .nav-link {
        padding: 6px 10px !important;
        font-size: 12.5px !important;
    }
}

@media (max-width: 640px) {
    /* On secondary public pages (commands/docs/terms/privacy), hide extra pill on narrow phones */
    .nav-links .nav-link.nav-premium-btn {
        display: none !important;
    }
    .nav-links .nav-link.nav-commands-link .nav-cmd-badge {
        display: none;
    }

    .hero-content {
        padding: 88px 16px 68px;
    }

    .hero-title {
        font-size: clamp(32px, 9.4vw, 46px);
        line-height: 1.08;
    }

    .hero-desc {
        font-size: 14.5px;
        line-height: 1.62;
        margin-top: 16px;
        padding: 0 4px;
    }

    .hero-actions {
        margin-top: 26px;
        flex-direction: column;
        align-items: center;
        gap: 11px;
        width: 100%;
    }

    .btn-add-discord,
    .btn-browse,
    .btn-hero-dashboard {
        width: 100%;
        max-width: 310px;
        justify-content: center;
        min-height: 50px;
    }

    .btn-add-discord {
        justify-content: space-between;
        padding: 7px 7px 7px 22px;
    }

    .rocks-front {
        height: 26%;
    }

    /* Clean glass feature cards on phones */
    .features {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 40px 16px 52px;
    }

    .feature,
    .feature:first-child,
    .feature:nth-child(odd) {
        border-left: none;
        padding: 20px 18px;
        border-radius: 18px;
        background: linear-gradient(165deg, rgba(28, 17, 82, 0.52) 0%, rgba(13, 8, 42, 0.72) 100%);
        border: 1px solid rgba(190, 180, 255, 0.14);
        box-shadow: 0 12px 30px rgba(4, 2, 20, 0.35);
    }

    .feature i {
        margin-bottom: 12px;
        font-size: 21px;
    }
}

@media (max-width: 420px) {
    .brand-logo span {
        max-width: 118px;
    }
    .float {
        display: none !important;
    }
}
