/* =========================================================================
   RuneClicker — Mobile Nav v2 (preview)
   Loaded only by newbuttons.html. Scoped under body.nav-v2.
   ========================================================================= */

@media (max-width: 768px) {

    /* Floating chat button redundant — chat lives in the drawer */
    body.nav-v2 .mobile-chat-btn { display: none !important; }

    /* ===== DOCK (bottom bar) ===== */
    body.nav-v2 #mobile-tab-strip {
        display: flex !important;
        height: 62px;
        padding: 0 6px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background:
            linear-gradient(180deg, #1e1914 0%, #110d08 60%, #050302 100%) !important;
        border: none;
        border-top: 1px solid rgba(255,152,31,0.18);
        box-shadow:
            0 -10px 28px rgba(0,0,0,0.6),
            inset 0 1px 0 rgba(255,200,120,0.08);
        align-items: stretch;
        justify-content: space-around;
        gap: 2px;
        overflow: visible;
        position: relative;
    }
    body.nav-v2 #mobile-tab-strip::before {
        content: '';
        position: absolute;
        inset: 0 0 auto 0;
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, rgba(255,152,31,0.55) 50%, transparent 100%);
        pointer-events: none;
        display: block;
    }
    body.nav-v2 #mobile-tab-strip::after {
        content: '';
        position: absolute;
        left: 50%;
        top: -30px;
        width: 84px;
        height: 52px;
        transform: translateX(-50%);
        background: radial-gradient(ellipse at 50% 100%, #0a0806 0%, #0a0806 55%, rgba(10,8,6,0) 75%);
        pointer-events: none;
        display: block;
        z-index: 0;
    }

    /* Dock button */
    body.nav-v2 #mobile-tab-strip .mts-btn {
        flex: 1 1 0;
        min-width: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        padding: 6px 0 4px;
        cursor: pointer;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.12s ease;
        z-index: 1;
        font-family: inherit;
        color: inherit;
    }
    body.nav-v2 #mobile-tab-strip .mts-btn:active { transform: scale(0.92); }

    body.nav-v2 #mobile-tab-strip .mts-btn > img {
        width: 26px;
        height: 26px;
        opacity: 0.5;
        filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.8));
        transition: opacity .2s ease, filter .2s ease, transform .2s ease;
    }
    body.nav-v2 #mobile-tab-strip .mts-btn .mts-label {
        font-size: 8.5px;
        letter-spacing: 0.9px;
        font-weight: 700;
        text-transform: uppercase;
        color: rgba(230,200,150,0.38);
        text-shadow: 1px 1px 0 #000;
        line-height: 1;
        transition: color .2s ease, text-shadow .2s ease;
    }
    body.nav-v2 #mobile-tab-strip .mts-btn.active > img {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(255,152,31,0.65)) drop-shadow(1px 1px 1px rgba(0,0,0,0.6));
        transform: translateY(-1px);
    }
    body.nav-v2 #mobile-tab-strip .mts-btn.active .mts-label {
        color: #ffc97a;
        text-shadow: 1px 1px 0 #000, 0 0 8px rgba(255,152,31,0.5);
    }
    /* Firelight bar at top edge — override old dot */
    body.nav-v2 #mobile-tab-strip .mts-btn.active::after {
        content: none !important;
    }
    body.nav-v2 #mobile-tab-strip .mts-btn.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 2.5px;
        border-radius: 0 0 6px 6px;
        background: linear-gradient(180deg, #ffd389, #ff8a1f);
        box-shadow:
            0 0 10px rgba(255,152,31,0.85),
            0 0 22px rgba(255,152,31,0.45);
    }

    /* Hero Bank orb — lifted out of the dock notch */
    body.nav-v2 #mobile-tab-strip .mts-btn.mts-center {
        flex: 0 0 80px;
        padding: 0;
        justify-content: flex-start;
        gap: 2px;
        z-index: 2;
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    body.nav-v2 #mobile-tab-strip .mts-btn.mts-center .mts-hero {
        width: 58px;
        height: 58px;
        margin-top: -26px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background:
            radial-gradient(circle at 32% 26%, #ffe6ad 0%, #f2ae5a 30%, #a25f1c 70%, #3d1e06 100%);
        border: 2px solid #0a0806;
        box-shadow:
            0 0 0 2px #5a3410,
            0 6px 16px rgba(0,0,0,0.75),
            inset 0 2px 4px rgba(255,255,255,0.28),
            inset 0 -6px 10px rgba(0,0,0,0.4);
        position: relative;
        transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s;
    }
    body.nav-v2 #mobile-tab-strip .mts-btn.mts-center .mts-hero::after {
        content: '';
        position: absolute;
        inset: 4px;
        border-radius: 50%;
        background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.35), transparent 50%);
        pointer-events: none;
    }
    body.nav-v2 #mobile-tab-strip .mts-btn.mts-center .mts-hero img {
        width: 32px;
        height: 32px;
        opacity: 1;
        filter: drop-shadow(0 2px 3px rgba(0,0,0,0.65));
        position: relative;
        z-index: 1;
        transform: none !important;
    }
    body.nav-v2 #mobile-tab-strip .mts-btn.mts-center .mts-label {
        color: #ffc97a;
        opacity: 0.7;
        margin-top: 2px;
    }
    body.nav-v2 #mobile-tab-strip .mts-btn.mts-center.active .mts-hero {
        transform: translateY(-3px) scale(1.05);
        box-shadow:
            0 0 0 2px #ffb54d,
            0 0 24px rgba(255,152,31,0.75),
            0 6px 18px rgba(0,0,0,0.75),
            inset 0 2px 4px rgba(255,255,255,0.35),
            inset 0 -6px 10px rgba(0,0,0,0.35);
    }
    body.nav-v2 #mobile-tab-strip .mts-btn.mts-center.active .mts-label { opacity: 1; }
    body.nav-v2 #mobile-tab-strip .mts-btn.mts-center.active::before { display: none; }
    body.nav-v2 #mobile-tab-strip .mts-btn.mts-center:active .mts-hero { transform: scale(0.95); }

    /* ===== SUB-DOCK (segmented carved ledge sitting directly on top of the dock) =====
       Reordered from top-of-screen to just above the dock so it sits in thumb reach
       and visually reads as an extension of the dock rather than a floating bar. */
    body.nav-v2 #mobile-tab-strip-top {
        order: 9 !important;
        height: 38px !important;
        padding: 4px 10px 0 !important;
        gap: 6px !important;
        background:
            linear-gradient(180deg, #130f0a 0%, #1a1510 100%) !important;
        border: none !important;
        border-top: 1px solid rgba(255,152,31,0.14) !important;
        border-bottom: none !important;
        box-shadow:
            inset 0 1px 0 rgba(255,200,120,0.06),
            0 -3px 10px rgba(0,0,0,0.35) !important;
        overflow: visible !important;
        align-items: stretch !important;
        justify-content: center !important;
        position: relative;
        animation: nv2SubIn .22s cubic-bezier(.22,1,.36,1);
    }
    body.nav-v2 #mobile-tab-strip-top.nv2-hidden { display: none !important; }

    /* Firelight emanating from the dock into the sub-dock */
    body.nav-v2 #mobile-tab-strip-top::before {
        content: '';
        position: absolute;
        left: 12%;
        right: 12%;
        bottom: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, rgba(255,152,31,0.5) 50%, transparent 100%);
        pointer-events: none;
    }
    body.nav-v2 #mobile-tab-strip-top::after {
        content: '';
        position: absolute;
        left: 0; right: 0; bottom: -1px;
        height: 10px;
        background: radial-gradient(ellipse at 50% 100%, rgba(255,152,31,0.18), transparent 65%);
        pointer-events: none;
    }

    @keyframes nv2SubIn {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* Segmented pills — now equal-weight slices that span the bar */
    body.nav-v2 #mobile-tab-strip-top .mts-btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: 120px !important;
        height: 30px !important;
        padding: 0 8px !important;
        border-radius: 8px 8px 4px 4px !important;
        background:
            linear-gradient(180deg, #2b2219 0%, #1a130d 100%) !important;
        border: 1px solid rgba(255,200,120,0.1) !important;
        border-bottom: none !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: background .18s, border-color .18s, box-shadow .18s, transform .12s;
        font-family: inherit;
        color: inherit;
        position: relative;
        box-shadow:
            inset 0 1px 0 rgba(255,200,120,0.05),
            inset 0 -2px 4px rgba(0,0,0,0.35) !important;
    }
    body.nav-v2 #mobile-tab-strip-top .mts-btn:active { transform: scale(0.96) translateY(1px); }
    body.nav-v2 #mobile-tab-strip-top .mts-btn > img {
        width: 16px !important;
        height: 16px !important;
        opacity: 0.55 !important;
        filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.7)) !important;
        transform: none !important;
    }
    body.nav-v2 #mobile-tab-strip-top .mts-btn .mts-label {
        font-size: 10.5px;
        letter-spacing: 0.4px;
        font-weight: 600;
        color: rgba(230,200,150,0.55);
        text-shadow: 1px 1px 0 #000;
        text-transform: none;
        line-height: 1;
        white-space: nowrap;
    }

    /* Active pill — carved gold tablet with inner glow, "raised" feel */
    body.nav-v2 #mobile-tab-strip-top .mts-btn.active {
        background:
            linear-gradient(180deg, rgba(255,170,60,0.28) 0%, rgba(180,100,30,0.18) 60%, rgba(100,55,15,0.1) 100%) !important;
        border-color: rgba(255,180,90,0.55) !important;
        border-bottom-color: transparent !important;
        box-shadow:
            inset 0 1px 0 rgba(255,210,140,0.35),
            inset 0 -6px 10px rgba(0,0,0,0.25),
            0 -2px 10px rgba(255,152,31,0.35),
            0 0 0 1px rgba(255,152,31,0.28) !important;
        transform: translateY(-1px);
    }
    body.nav-v2 #mobile-tab-strip-top .mts-btn.active > img {
        opacity: 1 !important;
        filter: drop-shadow(0 0 6px rgba(255,152,31,0.55)) drop-shadow(1px 1px 1px rgba(0,0,0,0.6)) !important;
    }
    body.nav-v2 #mobile-tab-strip-top .mts-btn.active .mts-label {
        color: #ffe3b0;
        text-shadow: 1px 1px 0 #000, 0 0 8px rgba(255,152,31,0.55);
    }
    body.nav-v2 #mobile-tab-strip-top .mts-btn.active::after {
        content: '' !important;
        position: absolute;
        left: 0; right: 0;
        bottom: -1px;
        height: 2px;
        background: linear-gradient(90deg, transparent 10%, #ffb54d 50%, transparent 90%);
        box-shadow: 0 0 10px rgba(255,152,31,0.8);
    }

    /* ===== DRAWER ("Grimoire") ===== */
    body.nav-v2 .rc-drawer-scrim {
        position: fixed;
        inset: 0;
        background:
            radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.55) 70%);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 9998;
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }
    body.nav-v2 .rc-drawer-scrim.open { opacity: 1; pointer-events: auto; }

    body.nav-v2 .rc-drawer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 78vh;
        background:
            linear-gradient(180deg, #2b231a 0%, #1a140e 42%, #0d0905 100%);
        border-top: 2px solid #ff981f;
        border-radius: 18px 18px 0 0;
        box-shadow:
            0 -20px 60px rgba(0,0,0,0.85),
            inset 0 1px 0 rgba(255,200,120,0.14);
        transform: translateY(100%);
        transition: transform .34s cubic-bezier(.22,1,.36,1);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    body.nav-v2 .rc-drawer.open { transform: translateY(0); }
    body.nav-v2 .rc-drawer::before {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: radial-gradient(ellipse at 50% 0%, rgba(255,152,31,0.18), transparent 55%);
        mix-blend-mode: screen;
    }
    body.nav-v2 .rc-drawer-grabber {
        width: 44px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255,200,120,0.32);
        margin: 8px auto 0;
        flex-shrink: 0;
    }
    body.nav-v2 .rc-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px 4px;
        flex-shrink: 0;
    }
    body.nav-v2 .rc-drawer-title {
        font-family: 'Cinzel', 'IM Fell English SC', serif;
        font-size: 15px;
        font-weight: 700;
        color: #ffd58a;
        letter-spacing: 3.5px;
        text-transform: uppercase;
        text-shadow: 0 1px 0 #000, 0 0 14px rgba(255,152,31,0.4);
    }
    body.nav-v2 .rc-drawer-close {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,200,120,0.22);
        color: #e6c896;
        font-size: 20px;
        line-height: 1;
        font-weight: 300;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        font-family: inherit;
    }
    body.nav-v2 .rc-drawer-close:active {
        background: rgba(255,152,31,0.12);
        border-color: rgba(255,152,31,0.5);
    }
    body.nav-v2 .rc-drawer-body {
        flex: 1;
        overflow-y: auto;
        padding: 4px 12px 18px;
        -webkit-overflow-scrolling: touch;
    }
    body.nav-v2 .rc-drawer-section { margin-top: 14px; }
    body.nav-v2 .rc-drawer-section-head {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 2px 8px;
    }
    body.nav-v2 .rc-drawer-section-head::before,
    body.nav-v2 .rc-drawer-section-head::after {
        content: '';
        flex: 1;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255,152,31,0.28), transparent);
    }
    body.nav-v2 .rc-drawer-section-title {
        font-family: 'Cinzel', 'IM Fell English SC', serif;
        font-size: 10px;
        letter-spacing: 3.5px;
        color: rgba(230,200,150,0.72);
        text-transform: uppercase;
        font-weight: 600;
        white-space: nowrap;
    }
    body.nav-v2 .rc-drawer-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    body.nav-v2 .rc-drawer-tile {
        aspect-ratio: 1 / 1.1;
        background: linear-gradient(180deg, #3a2f22 0%, #221a12 52%, #120d07 100%);
        border: 1px solid rgba(255,200,120,0.14);
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 4px;
        position: relative;
        overflow: hidden;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        box-shadow:
            inset 0 1px 0 rgba(255,200,120,0.1),
            inset 0 -4px 8px rgba(0,0,0,0.35),
            0 2px 4px rgba(0,0,0,0.45);
        opacity: 0;
        transform: translateY(10px) scale(0.96);
        animation: nv2TileIn .42s cubic-bezier(.22,1,.36,1) forwards;
        transition: border-color .15s, transform .12s;
        font-family: inherit;
        color: inherit;
    }
    body.nav-v2 .rc-drawer-tile::after {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(ellipse at 50% 0%, rgba(255,200,120,0.08), transparent 60%);
        pointer-events: none;
    }
    body.nav-v2 .rc-drawer-tile:active {
        transform: scale(0.94);
        border-color: rgba(255,152,31,0.6);
    }
    body.nav-v2 .rc-drawer-tile img {
        width: 30px;
        height: 30px;
        filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.7));
    }
    body.nav-v2 .rc-drawer-tile-emoji {
        font-size: 24px;
        line-height: 1;
        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));
    }
    body.nav-v2 .rc-drawer-tile-label {
        font-size: 9.5px;
        letter-spacing: 0.4px;
        color: #e6c896;
        font-weight: 600;
        text-shadow: 1px 1px 0 #000;
        text-align: center;
        line-height: 1.15;
        padding: 0 2px;
    }
    @keyframes nv2TileIn {
        to { opacity: 1; transform: translateY(0) scale(1); }
    }
}

@media (max-width: 380px) {
    body.nav-v2 .rc-drawer-grid { grid-template-columns: repeat(3, 1fr); }
}
