/* ═══════════════════════════════════════════════════════════════
   X10 MOBILE BOTTOM NAVIGATION
   Markup: partials/mobile-bottom-nav.blade.php (the only bottom bar).
   Visible below 992px (the same breakpoint where the header switches to its mobile layout).
   Navy surface, hairline top border, gold active item, 44px+ touch targets, safe-area aware.
   ═══════════════════════════════════════════════════════════════ */

:root {
    --x10-nav-bg: #001021;
    --x10-nav-border: rgba(255, 255, 255, 0.1);
    --x10-nav-gold: #E9A722;
    --x10-nav-text: rgba(255, 255, 255, 0.66);
    --x10-nav-text-hover: #FFFFFF;
    --x10-nav-height: 60px;
    --x10-nav-total: calc(var(--x10-nav-height) + env(safe-area-inset-bottom, 0px));
}

.x10-bottom-nav { display: none; }

@media (max-width: 991px) {
    .x10-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;               /* below the wallet popup (10050) and above page content */
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        width: 100%;
        height: var(--x10-nav-total);
        padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
        background: var(--x10-nav-bg);
        border-top: 1px solid var(--x10-nav-border);
        transition: transform 180ms ease;
    }

    /* Hidden while a form field is focused (on-screen keyboard) so it never covers what is being typed. */
    .x10-bottom-nav.is-away { transform: translateY(100%); }

    /* Reserve space so the last row / pagination / form button scrolls fully above the bar.
       Only on pages that render the bar (class set by the layout); standalone game pages have no bar. */
    body.x10-has-bottomnav {
        padding-bottom: calc(var(--x10-nav-total) + 8px) !important;
        /* A global `transition: all` on body can leave this padding stuck at its start value
           (0) on some pages: apply it instantly instead. */
        transition: none !important;
    }
}

@media (min-width: 992px) {
    .x10-bottom-nav { display: none !important; }
    body.x10-has-bottomnav { padding-bottom: 0 !important; }
}

/* ── Items ─────────────────────────────────────────────── */

.x10-nav-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 6px 2px 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--x10-nav-text);
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color 160ms ease, background-color 160ms ease;
}
.x10-nav-item:hover { color: var(--x10-nav-text-hover); text-decoration: none; }
.x10-nav-item:active { background: rgba(255, 255, 255, 0.07); }
.x10-nav-item:focus { outline: none; }
.x10-nav-item:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

.x10-nav-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: block;
}

.x10-nav-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-align: center;
}

/* ── Active ────────────────────────────────────────────── */

.x10-nav-item.active { color: var(--x10-nav-gold); }
.x10-nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;                       /* sits on the bar's top border */
    left: 50%;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--x10-nav-gold);
    transform: translateX(-50%);
}

/* ── Narrow phones ─────────────────────────────────────── */

@media (max-width: 340px) {
    .x10-nav-label { font-size: 9px; letter-spacing: 0; }
    .x10-nav-icon { flex-basis: 20px; width: 20px; height: 20px; }
}

/* Short landscape phones: keep the bar compact */
@media (max-width: 991px) and (max-height: 480px) and (orientation: landscape) {
    :root { --x10-nav-height: 48px; }
    .x10-nav-item { flex-direction: row; gap: 6px; justify-content: center; padding: 0 4px; }
    .x10-nav-icon { flex-basis: 20px; width: 20px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .x10-bottom-nav, .x10-nav-item { transition: none; }
}
