/* 
  MOBILE FRONTEND - LOCKED
  Do not modify any existing rules in this file.
  New features may only ADD new rules using gw-mobile__* naming.
  No existing rule may be changed, removed, or overridden.
  Any change that affects the current mobile layout is rejected.
*/

/* 
  GLITCH WORLD CSS ARCHITECTURE
  New components use gw-[component]__[element] naming
  Never use generic selectors like h1, h2 without a parent class prefix
  Never override glitch-70 globally — it's a shared animation class
*/

/* ============================================
   GLITCH WORLD — ADAPTIVE MOBILE LAYOUT ENGINE
   Loaded ONLY by base_mobile.html
   Cards and typography are READ-ONLY (shared via custom.css)
   This file controls: spacing, layout, wrappers, effects
   INTELLIGENT: Adapts to any viewport, orientation, notch
   ============================================ */

/* ============================================
   VIEWPORT-AWARE FOUNDATION
   Uses dvh (dynamic viewport height) for Samsung/iOS
   ============================================ */
:root {
    --gw-header-h: 50px;
    --gw-footer-h: 70px;
    --gw-safe-top: env(safe-area-inset-top, 0px);
    --gw-safe-bottom: env(safe-area-inset-bottom, 0px);
    --gw-safe-left: env(safe-area-inset-left, 0px);
    --gw-safe-right: env(safe-area-inset-right, 0px);
    
    /* Intelligent Spacing Engine - Dynamic Viewport Tokens */
    --gw-card-top-offset: clamp(30px, 8vh, 60px);
    --gw-section-gap: clamp(20px, 5vh, 40px);
    --gw-header-adj: var(--gw-header-h);
}

/* Phantom Layer Protection: Ensure background effects don't steal touch events */
.gw-mobile__snake-hero,
.gw-mobile__snake-node::before,
.gw-mobile__snake-node::after {
    pointer-events: none !important;
}
.gw-mobile__snake-hero p, 
.gw-mobile__snake-hero h1, 
.gw-mobile__snake-hero div,
.gw-mobile__snake-hero a,
.gw-mobile__snake-hero .btn,
.gw-mobile__snake-hero span {
    pointer-events: auto !important;
}

/* Ensure the carousel stage doesn't have an invisible mask blocking the events */
.mobile-carousel-stage {
    pointer-events: none !important;
}
.signals-table-container, .terminal-card, .terminal-carousel-container {
    pointer-events: auto !important;
}

/* Fix z-index for tier overlays to ensure they don't block the navbar/tabs */
.tier-ghost-overlay {
    z-index: 900 !important;
    pointer-events: auto !important;
}
.is-brave, .is-edge {
    --gw-header-adj: 40px;
    --gw-card-top-offset: clamp(30px, 7vh, 60px); /* Reduced from 40px/10vh */
    --gw-section-gap: clamp(20px, 4vh, 40px); /* Reduced from 25px/6vh */
}

.is-samsung {
    --gw-section-gap: clamp(20px, 4vh, 40px);
}

.is-safari {
    --gw-card-top-offset: clamp(25px, 6vh, 50px);
}

/* Universal Vertical rhythm engine - Single source of truth */
body.mobile-app .mobile-main {
    position: fixed !important;
    top: var(--gw-header-adj) !important;
    bottom: calc(var(--gw-footer-h) + var(--gw-safe-bottom)) !important;
    height: calc(100dvh - var(--gw-header-adj) - var(--gw-footer-h) - var(--gw-safe-bottom)) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; /* Forces vertical centering across all browsers */
    align-items: center !important;
    left: var(--gw-safe-left) !important;
    right: var(--gw-safe-right) !important;
    width: auto !important;
    z-index: 5 !important;
    padding-top: 0 !important; /* Remove top offset to allow true center */
}

/* Short Screen Intelligence Protocol (e.g. iPhone SE) */
@media (max-height: 670px) {
    :root {
        --gw-header-adj: 45px;
        --gw-footer-h: 60px;
    }
    body.mobile-app .mobile-main {
        padding-top: 10px !important;
    }
}

body.mobile-app .section-description-wrapper {
    width: 100% !important;
    text-align: center !important;
    padding: 10px 16px !important;
    flex-shrink: 0 !important;
    margin-top: 10px !important;
}

body.mobile-app .section-description-text {
    font-size: 0.65rem !important;
    letter-spacing: 1px !important;
    color: var(--gw-text-main) !important;
    opacity: 0.85;
    text-transform: uppercase;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    white-space: normal !important;
}

body.mobile-app .terminal-card {
    transform: scale(0.9) !important;
    transform-origin: center center !important;
    margin: 0 -20px -50px -20px !important;
    width: calc(100vw - 40px) !important; /* Fixed width to prevent bleeding */
    max-width: 400px !important;
    box-sizing: border-box !important;
}

/* SINGLE SOURCE OF TRUTH FOR MOBILE CAROUSEL - Calibrated for smooth swiping */
body.mobile-app:not(.mobile-home) .mobile-carousel-stage .terminal-carousel-container,
body.mobile-app:not(.mobile-home) .signals-table-container,
body.mobile-app:not(.mobile-home) #live-radar-container,
body.mobile-app:not(.mobile-home) #momentum-container,
body.mobile-app:not(.mobile-home) #historical-signals-container {
    width: 100vw !important;
    height: 500px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    padding: 0 20px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    scrollbar-width: none !important;
    mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent) !important;
    -webkit-mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent) !important;
    pointer-events: auto !important;
    z-index: 10 !important;
}

/* Force Absolute Deep Dark Background - Targeted at Edge/WebKit/Blink */
html, body.mobile-app, .mobile-main, .mobile-signal-section, .mobile-main-wrapper, .navbar, .mobile-bottom-tabs {
    background-color: #0E1116 !important;
    background: #0E1116 !important;
    overflow: hidden !important;
    height: 100dvh !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-tap-highlight-color: transparent;
}

/* Cache-busting for Replit Preview */
html::after {
    content: "v1.0.1";
    display: none;
}

/* ============================================
   CROSS-BROWSER VIEWPORT LOCK
   Orientation-invariant. Same layout in portrait and landscape.
   ============================================ */
body.mobile-app {
    width: 100vw !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    position: fixed !important;
    background-color: #0E1116 !important;
    background: #0E1116 !important;
    -webkit-text-size-adjust: 100%;
    left: 0 !important;
    top: 0 !important;
}

/* Samsung Internet/Edge Android Bottom Nav Fix */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-tabs {
        padding-bottom: max(env(safe-area-inset-bottom), 15px) !important;
    }
}

/* CAROUSEL CONTAINER — THE PERFECTION FIX
   Using flex-grow and absolute positioning for true center
*/
body.mobile-app:not(.mobile-home) .mobile-main {
    position: fixed !important;
    top: calc(var(--gw-header-h) + var(--gw-safe-top)) !important;
    bottom: calc(var(--gw-footer-h) + var(--gw-safe-bottom)) !important;
    left: 0 !important;
    right: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; /* Perfect Vertical Center */
    align-items: center !important;
    z-index: 5 !important;
    background: #0E1116 !important;
}

body.mobile-app:not(.mobile-home) .terminal-carousel-container,
body.mobile-app:not(.mobile-home) #live-radar-container,
body.mobile-app:not(.mobile-home) #momentum-container,
body.mobile-app:not(.mobile-home) #historical-signals-container {
    flex: 0 0 500px !important;
    height: 500px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    gap: 40px !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    /* Mask for silent design */
    mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent) !important;
    -webkit-mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent) !important;
}

/* ============================================
   FIXED HEADER — Viewport-locked
   ============================================ */
body.mobile-app .navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 50px !important;
    padding: 0 !important;
    padding-top: var(--gw-safe-top) !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #0E1116 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

body.mobile-app .navbar .container {
    padding: 0 16px !important;
    max-width: 100% !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

.navbar-brand {
    font-size: 0.9rem !important;
    width: auto !important;
    text-align: center !important;
    margin: 0 auto !important;
    padding: 0 !important;
    letter-spacing: 0.05em !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    color: var(--gw-text-main) !important;
    opacity: 1 !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
}

/* CAROUSEL CONTAINER — Centered for all mobile browsers and Replit preview */
body.mobile-app:not(.mobile-home) .terminal-carousel-container,
body.mobile-app:not(.mobile-home) .signals-table-container,
body.mobile-app:not(.mobile-home) #live-radar-container,
body.mobile-app:not(.mobile-home) #momentum-container,
body.mobile-app:not(.mobile-home) #historical-signals-container {
    flex: 0 0 500px !important;
    height: 500px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 auto !important; 
    padding: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    gap: 40px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    scroll-padding: 0 !important;
    scroll-behavior: auto !important;
    width: 100% !important;
    mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent) !important;
    -webkit-mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent) !important;
}

/* ============================================
   FIXED FOOTER — Bottom tabs with safe-area
   ============================================ */

/* Fill screen width */
.terminal-card {
  width: calc(100vw - 32px) !important;
  max-width: none !important;
  flex: 0 0 calc(100vw - 32px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 24px 0 !important; /* Zero horizontal padding to allow internal elements to be flush */
}

/* Taller chart */
.card-chart-container {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  height: 75px !important;
}

.card-chart-container canvas {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}


/* Reduce dead space above cards */
.cards-feed, .card-list, .carousel-inner, .mobile-carousel-stage, .mobile-main, .mobile-main-wrapper {
  padding-top: 12px !important;
}

/* Section Header Optimization */
.mobile-feed-header h5, 
.glass-card .desktop-section-header h1.gw-header__title, 
.glass-card .desktop-section-header h1,
.mobile-section-indicator {
  font-size: 15px !important;
  letter-spacing: 2px !important;
  margin-bottom: 8px !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
}

.card-header-bar, .metrics-strip, .card-footer-bar {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.card-header-left {
  padding-left: 0 !important;
}
.card-header-right {
  padding-right: 0 !important;
}
.card-chart-container {
  padding: 0 !important;
}

body.mobile-app .mobile-bottom-tabs {
    display: none !important;
}

@media (max-width: 768px) {
    body.mobile-app .mobile-bottom-tabs {
        display: flex !important;
    }
}

.mobile-bottom-tabs {
    display: flex;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(var(--gw-footer-h) + var(--gw-safe-bottom)) !important;
    z-index: 1000 !important;
    background: #0E1116 !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 10px !important;
    padding-bottom: calc(0.5rem + var(--gw-safe-bottom)) !important;
    justify-content: space-between !important;
    align-items: center;
    overflow: hidden !important;
    width: 100% !important;
    contain: layout size;
    box-sizing: border-box !important;
}

    .mobile-tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        text-decoration: none;
        color: var(--gw-text-main) !important;
        opacity: 0.85;
        font-size: 0.6rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        padding: 0.25rem 0 !important;
        transition: all 0.2s;
        flex: 1 1 0% !important;
        min-width: 0 !important;
        max-width: 25% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: clip !important;
        text-align: center !important;
    }
    .mobile-tab-item.active {
        color: #14F195 !important;
        opacity: 1 !important;
    }
    .mobile-tab-item svg {
        opacity: 0.85;
        stroke-width: 2.5;
    }
    .mobile-tab-item.active svg {
        opacity: 1;
        stroke: #14F195 !important;
    }

/* ============================================
   MAIN CONTENT AREA — Dynamic safe zone
   Sits between header and footer, never overlaps
   ============================================ */
body.mobile-app .mobile-main {
    position: fixed !important;
    top: 50px !important;
    bottom: 70px !important;
    left: var(--gw-safe-left) !important;
    right: var(--gw-safe-right) !important;
    width: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; /* Center content vertically in the available space */
    align-items: center !important;
    padding: 0 !important; /* Removed 30px top padding causing offset */
    margin: 0 !important;
    overflow: visible !important;
    z-index: 5 !important;
    min-height: auto !important;
}

/* ============================================
   WRAPPER — The single scrollable/centered container
   ============================================ */
.mobile-main-wrapper {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-overflow-scrolling: touch;
}

.mobile-main .container,
.mobile-main > div {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    width: 100%;
}

/* ============================================
   HOME PAGE — Hero header visible, cards scrollable
   ============================================ */
body.mobile-app .mobile-header-wrapper {
    display: none !important;
}

body.mobile-app.mobile-home .mobile-header-wrapper {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-shrink: 0;
    padding: 20px 0 10px 0 !important;
}

body.mobile-app.mobile-home .mobile-home-logo {
    text-align: center;
    pointer-events: auto;
    width: 100%;
}

body.mobile-app.mobile-home .mobile-main {
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    height: var(--gw-content-h) !important;
    padding-bottom: 80px !important;
    -webkit-overflow-scrolling: touch;
    /* Ensure hero stays centered even when content is small */
    min-height: var(--gw-content-h) !important;
}

body.mobile-app.mobile-home .mobile-main-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    padding: 0 !important;
}

/* ============================================
   BROWSER-SPECIFIC VERTICAL ALIGNMENT ENGINE
   Each browser handles fixed headers and safe-areas differently.
   We force absolute independence for Brave, Safari, and Firefox.
   ============================================ */

/* Brave & Edge (Chromium) — Forced Centering Fix */
.is-brave body.mobile-app .navbar,
.is-edge body.mobile-app .navbar {
    height: 40px !important;
    padding-top: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
}

.is-brave body.mobile-app .navbar .container,
.is-edge body.mobile-app .navbar .container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

.is-brave .navbar-brand,
.is-edge .navbar-brand {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    width: auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 0.85rem !important;
}

/* REMOVED: Redundant Edge/Brave block - Now handled by Universal rhythm engine */

/* Safari (iOS) — Safe Area Management */
.is-safari body.mobile-app .navbar {
    height: calc(50px + env(safe-area-inset-top)) !important;
}

.is-safari body.mobile-app .mobile-main {
    top: calc(50px + env(safe-area-inset-top)) !important;
    bottom: calc(70px + env(safe-area-inset-bottom)) !important;
}

/* Fire Tablet & Large Mobile Landscape Optimization - FORCED LANDSCAPE */
@media (min-width: 600px) and (max-width: 1366px) and (orientation: portrait) {
    body.mobile-app::before,
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background: #0d0d0d;
        z-index: 1000000 !important;
    }
    #rotate-overlay {
        display: flex !important;
        z-index: 1000001 !important;
        background: #0d0d0d !important;
        pointer-events: auto !important;
    }
}

/* Tablet Grid Engine - Landscape */
@media (min-width: 769px) and (max-width: 1366px) and (orientation: landscape) {
    body.mobile-app .mobile-main {
        position: relative !important;
        top: 0 !important;
        display: block !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
        padding: 80px 20px !important;
    }
    body.mobile-app .terminal-carousel-container,
    body.mobile-app #live-radar-container,
    body.mobile-app #momentum-container,
    body.mobile-app #historical-signals-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
        width: 100% !important;
        height: auto !important;
        mask-image: none !important;
        -webkit-mask-image: none !important;
        overflow: visible !important;
    }
    body.mobile-app .terminal-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        transform: scale(1) !important;
    }
}

/* Samsung Internet — Navigation Bar Buffer */
.is-samsung body.mobile-app .mobile-bottom-tabs {
    padding-bottom: max(env(safe-area-inset-bottom), 20px) !important;
}

/* ============================================
   SIGNAL SECTIONS — Each card section block
   ============================================ */
.mobile-signal-section {
    width: 100%;
    flex-shrink: 0;
    margin-bottom: 2rem; /* Add breathing room between stacked sections */
    background: #0E1116 !important; /* Force deep dark background */
}

body.mobile-app.mobile-home .mobile-signal-section .glass-card {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================
   SECTION DESCRIPTIONS — Under each card carousel
   Always visible, never hidden
   ============================================ */
.section-description-wrapper {
    padding: 0.5rem 1rem;
    flex-shrink: 0;
}

.section-description-text {
    font-size: 0.7rem !important;
    letter-spacing: 1px;
    color: var(--gw-text-main) !important;
    opacity: 0.85;
    text-transform: uppercase;
    font-weight: 700 !important;
    line-height: 1.6;
}

.section-symbol {
    color: var(--gw-accent-yellow);
    font-size: 0.8rem;
    display: inline;
    vertical-align: baseline;
}

/* ============================================
   SUBDOMAIN FEED — Single section centered
   ============================================ */
body.mobile-app:not(.mobile-home) .mobile-main {
    position: fixed !important;
    top: calc(var(--gw-header-h) + var(--gw-safe-top)) !important;
    bottom: calc(var(--gw-footer-h) + var(--gw-safe-bottom)) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    z-index: 5 !important;
    height: auto !important;
}

body.mobile-app:not(.mobile-home) .mobile-main-wrapper {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.mobile-app:not(.mobile-home) .mobile-signal-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* CAROUSEL CONTAINER — Centered for all mobile browsers and Replit preview */
body.mobile-app:not(.mobile-home) .terminal-carousel-container,
body.mobile-app:not(.mobile-home) .signals-table-container,
body.mobile-app:not(.mobile-home) #live-radar-container,
body.mobile-app:not(.mobile-home) #momentum-container,
body.mobile-app:not(.mobile-home) #historical-signals-container {
    flex: 0 0 440px !important;
    height: 440px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 auto !important; 
    padding: 0 !important;
    padding-left: calc(50% - 155px) !important;
    padding-right: calc(50% - 155px) !important;
    box-sizing: border-box !important;
    gap: 60px !important; /* Increased gap to prevent bleed on Brave/Edge */
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    scroll-padding: 0 !important;
    scroll-behavior: auto !important;
    width: 100% !important;
    /* Heavy mask for silent design */
    mask-image: linear-gradient(to right, transparent, black 80px, black calc(100% - 80px), transparent) !important;
    -webkit-mask-image: linear-gradient(to right, transparent, black 80px, black calc(100% - 80px), transparent) !important;
}

/* HOME PAGE carousel containers — same centering but flexible height */
body.mobile-app.mobile-home .signals-table-container,
body.mobile-app.mobile-home #live-radar-container,
body.mobile-app.mobile-home #momentum-container,
body.mobile-app.mobile-home #historical-signals-container {
    height: 500px !important;
    min-height: 500px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    gap: 40px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: auto !important;
    width: 100% !important;
    mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent) !important;
    -webkit-mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent) !important;
}

/* Card sizing lock */
body.mobile-app .terminal-card {
    flex: 0 0 calc(100vw - 32px) !important;
    width: calc(100vw - 32px) !important;
    max-width: none !important;
    height: 400px !important; /* Increased from 360px to accommodate taller chart */
    scroll-snap-align: center !important;
    margin: 0 !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important; /* Align to top to reduce middle gap */
    padding: 15px 25px !important; /* Tighter padding */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.mobile-app .terminal-card .card-body {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important; /* Even tighter gap */
}

body.mobile-app .terminal-card .card-body hr {
    margin: 8px 0 !important; /* Tighten horizontal rules if they exist */
    opacity: 0.1;
}

/* Intelligent Header Proximity */
body.mobile-app .section-description-wrapper {
    padding: 0 !important;
    margin-bottom: -15px !important; /* Pulls header closer to the card */
    z-index: 10 !important;
    position: relative !important;
}

body.mobile-app .section-description-text {
    font-size: 0.55rem !important; /* Smaller, cleaner font */
    letter-spacing: 1.5px !important;
    margin-top: 0 !important;
}

/* Hide desktop spacers on mobile */
body.mobile-app .carousel-spacer,
body.mobile-app .desktop-nav-arrow {
    display: none !important;
}

/* ============================================
   SMALL PHONES (< 380px width) — Tighter fit
   ============================================ */
@media (max-width: 380px) {
    .section-description-text {
        font-size: 0.6rem !important;
        letter-spacing: 0.5px;
    }

    body.mobile-app .terminal-card {
        min-width: 280px !important;
        max-width: 280px !important;
        width: 280px !important;
        flex: 0 0 280px !important;
    }

    body.mobile-app:not(.mobile-home) .signals-table-container,
    body.mobile-app:not(.mobile-home) #live-radar-container,
    body.mobile-app:not(.mobile-home) #momentum-container,
    body.mobile-app:not(.mobile-home) #historical-signals-container {
        padding-left: calc(50% - 140px) !important;
        padding-right: calc(50% - 140px) !important;
    }

    body.mobile-app.mobile-home .signals-table-container,
    body.mobile-app.mobile-home #live-radar-container,
    body.mobile-app.mobile-home #momentum-container,
    body.mobile-app.mobile-home #historical-signals-container {
        padding-left: calc(50% - 140px) !important;
        padding-right: calc(50% - 140px) !important;
    }
}

/* ============================================
   TALL PHONES (> 800px height) — More breathing room
   ============================================ */
@media (min-height: 800px) and (orientation: portrait) {
    body.mobile-app.mobile-home .mobile-header-wrapper {
        padding: 2rem 0;
    }

    .mobile-signal-section {
        margin-bottom: 1.5rem;
    }
}

/* ============================================
   HIDE ELEMENTS THAT SHOULDN'T SHOW ON MOBILE
   ============================================ */
body.mobile-app .mobile-section-container,
body.subdomain-feed .mobile-section-container,
body.mobile-app .mobile-section-indicator,
body.subdomain-feed .mobile-section-indicator {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.mobile-app .section-descriptor,
body.subdomain-feed .section-descriptor {
    display: none !important;
}

body.mobile-app .mobile-feed-header,
body.mobile-app .desktop-section-header,
body.mobile-app .section-header-gw,
body.mobile-app .mobile-hide-disclaimer,
body.mobile-app .footer-marketing,
body.mobile-app #partnership-section,
body.mobile-app footer {
    display: none !important;
}

/* ============================================
body.mobile-app:not(.mobile-home) .row.mb-5.g-4 {
    margin: 0 !important;
    padding: 0 !important;
}

body.mobile-app:not(.mobile-home) .col-12,
body.mobile-app:not(.mobile-home) .col-md-6 {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (max-width: 768px) {
    body.mobile-app .row.mb-5,
    body.mobile-app .row.mb-5.g-4 {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.mobile-app .col-12 {
        width: 100% !important;
        padding: 0 !important;
    }
}

/* ============================================
   ALPHA TICKER FEED
   ============================================ */
.alpha-feed-wrapper {
    background: rgba(14, 17, 22, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 0.6rem 0;
    margin: 0;
    width: 100%;
    position: sticky;
    top: 50px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    height: 34px;
    display: flex;
    align-items: center;
}

.alpha-ticker {
    display: flex;
    white-space: nowrap;
    width: max-content;
    animation: ticker-scroll 45s linear infinite;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.alpha-item {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 2rem;
}

.alpha-item span:first-child {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--gw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.alpha-item span:last-child {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
}

.price-val.price-up { color: #10B981 !important; }
.price-val.price-down { color: #EF4444 !important; }

@media (min-width: 769px) {
    .alpha-feed-wrapper {
        display: none !important;
    }
}

/* ============================================
   MARKET TELEMETRY
   ============================================ */
.market-telemetry-container {
    height: 160px;
    width: 100%;
    position: relative;
    background: transparent;
    overflow: hidden;
    margin-bottom: 2rem;
    opacity: 0.4;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.telemetry-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

.telemetry-svg {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.telemetry-line {
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-telemetry 12s linear infinite alternate;
}

.line-btc {
    stroke: #F7931A;
    animation-delay: 0s;
}

.line-eth {
    stroke: #627EEA;
    animation-delay: 3s;
}

@keyframes draw-telemetry {
    0% { stroke-dashoffset: 1000; opacity: 0.2; transform: scaleX(0.95); }
    50% { opacity: 0.8; transform: scaleX(1); }
    100% { stroke-dashoffset: 0; opacity: 0.4; transform: scaleX(1.05); }
}

/* ============================================
   TAB GLITCH EFFECTS — TOGGLE INDEPENDENTLY
   ============================================ */
.tab-glitch-icon {
    display: inline-block;
    position: relative;
    z-index: 1;
}

.tab-glitch-text {
    display: inline-block;
    position: relative;
    z-index: 1;
}

@keyframes tabGlitchIcon {
    0%, 94%, 100% {
        filter: none;
        transform: none;
        opacity: 1;
    }
    94.5% {
        filter: drop-shadow(-2px 0 rgba(20, 241, 149, 0.6)) drop-shadow(2px 0 rgba(255, 0, 193, 0.5));
        transform: translateX(-1px) scale(1.05);
        opacity: 0.9;
    }
    95.5% {
        filter: drop-shadow(2px 0 rgba(20, 241, 149, 0.6)) drop-shadow(-2px 0 rgba(255, 0, 193, 0.5));
        transform: translateX(1px) rotate(2deg);
        opacity: 1;
    }
    96.5% {
        filter: drop-shadow(-1px 0 rgba(20, 241, 149, 0.4)) drop-shadow(1px 0 rgba(255, 0, 193, 0.3));
        transform: translateY(-1px);
        opacity: 0.95;
    }
    98% {
        filter: none;
        transform: none;
        opacity: 1;
    }
}

@keyframes tabGlitchText {
    0%, 92%, 100% {
        text-shadow: none;
        transform: none;
        opacity: 1;
    }
    92.5% {
        text-shadow: -2px 0 rgba(20, 241, 149, 0.6), 2px 0 rgba(255, 0, 193, 0.5);
        transform: translateX(-0.5px) scale(1.02);
        opacity: 0.9;
    }
    94% {
        text-shadow: 2px 0 rgba(20, 241, 149, 0.6), -2px 0 rgba(255, 0, 193, 0.5);
        transform: translateX(0.5px) rotate(-1deg);
        opacity: 1;
    }
    95.5% {
        text-shadow: -1px 0 rgba(20, 241, 149, 0.4), 1px 0 rgba(255, 0, 193, 0.3);
        transform: translateY(-0.5px);
        opacity: 0.95;
    }
    97% {
        text-shadow: none;
        transform: none;
        opacity: 1;
    }
}

.icon-1, .glitch-piano-1 { animation: tabGlitchIcon 8.4s infinite !important; animation-delay: 1.3s !important; }
.icon-2, .glitch-piano-2 { animation: tabGlitchIcon 11.2s infinite !important; animation-delay: 4.7s !important; }
.icon-3, .glitch-piano-3 { animation: tabGlitchIcon 9.6s infinite !important; animation-delay: 0.5s !important; }
.icon-4, .glitch-piano-4 { animation: tabGlitchIcon 12.5s infinite !important; animation-delay: 7.1s !important; }
.glitch-piano-5 { animation: tabGlitchIcon 14.2s infinite !important; animation-delay: 2.3s !important; }
.glitch-piano-6 { animation: tabGlitchIcon 10.8s infinite !important; animation-delay: 5.9s !important; }
.glitch-piano-7 { animation: tabGlitchIcon 13.1s infinite !important; animation-delay: 8.4s !important; }
.glitch-piano-8 { animation: tabGlitchIcon 11.7s infinite !important; animation-delay: 3.6s !important; }
.glitch-piano-9 { animation: tabGlitchIcon 15.5s infinite !important; animation-delay: 6.2s !important; }

.terminal-card [class*="glitch-piano-"] {
    animation: none !important;
}

.text-1 { animation: tabGlitchText 15.1s infinite !important; animation-delay: 2.8s !important; }
.text-2 { animation: tabGlitchText 13.5s infinite !important; animation-delay: 9.7s !important; }
.text-3 { animation: tabGlitchText 17.4s infinite !important; animation-delay: 1.2s !important; }
.text-4 { animation: tabGlitchText 16.6s infinite !important; animation-delay: 5.5s !important; }

.mobile-tab-item.active .tab-glitch-icon { animation-duration: 6.3s !important; }
.mobile-tab-item.active .tab-glitch-text { animation-duration: 8.1s !important; }

/* ============================================
   HERO TYPOGRAPHY — CSS-controlled, no inline styles
   ============================================ */
.hero-welcome-line {
    font-size: 1.1rem !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #FFFFFF !important;
    font-weight: 700 !important;
}

.hero-title-line {
    font-size: 2.2rem !important;
    color: #FFFFFF !important;
    line-height: 1.1;
}

.hero-subtitle-line {
    font-size: 0.95rem !important;
    text-transform: none;
    letter-spacing: 0.02em;
    color: var(--gw-text-muted);
}

/* glitch-70 width constraint */
.glitch-70 {
    width: auto !important;
    max-width: 90vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ============================================
   TAB LOADING FEEDBACK — Visual pulse on tap
   ============================================ */
.mobile-tab-item.tab-loading {
    pointer-events: none;
}

.mobile-tab-item.tab-loading .tab-glitch-icon,
.mobile-tab-item.tab-loading .tab-glitch-text {
    animation: tabLoadPulse 0.6s ease-in-out infinite !important;
}

@keyframes tabLoadPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   EMPTY STATE — Replaces initial spinner
   ============================================ */
.signal-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 420px;
    min-width: 310px;
    max-width: 310px;
    margin: 0 auto;
    color: var(--gw-text-muted);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

.signal-loading-state .loading-symbol {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    animation: tabLoadPulse 1.5s ease-in-out infinite;
}

/* ============================================
   TOKEN NAME OVERFLOW — Protect long names
   ============================================ */
.terminal-card .glitch-font {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
}

/* ============================================
   LOGIN PAGE LAYOUT LOCK
   ============================================ */
.login-page .mobile-main {
    height: 100dvh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 0 !important;
}

.login-page {
    background:
        radial-gradient(circle at 50% 0%, rgba(255,255,255,0.04), transparent 60%),
        var(--gw-bg, #0b0f14) !important;
}

/* ============================================
   ROTATE OVERLAY — Absolute Top Level
   Force visibility in all mobile browsers (Brave, Firefox, Edge, Chrome, Safari)
   ============================================ */
#rotate-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #0E1116 !important;
    color: white !important;
    z-index: 2147483647 !important; /* Maximum possible z-index */
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    pointer-events: all !important;
}

#rotate-overlay .rotate-icon {
    font-size: 48px !important;
    animation: rotate-icon-anim 2s infinite ease-in-out !important;
}

@keyframes rotate-icon-anim {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-90deg); }
    75% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

/* Portrait vs Landscape logic - Force via CSS as primary, JS as fallback */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    #rotate-overlay {
        display: flex !important;
    }
    body.mobile-app {
        overflow: hidden !important;
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
    }
}

/* Specific Browser Dimension Fixes */
/* Firefox Mobile (Gecko) */
@-moz-document url-prefix() {
    .mobile-bottom-tabs {
    .mobile-tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        text-decoration: none;
        color: var(--gw-text-muted);
        font-size: 0.6rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        padding: 0.25rem 1rem;
        transition: color 0.2s;
    }
        transition: color 0.2s;
    }
/* Safari (WebKit) */
@supports (-webkit-touch-callout: none) {
    .mobile-main {
        height: -webkit-fill-available !important;
    }
}

/* ============================================
   SNAKE-WRAP GLITCH — gw-mobile__snake-*
   Pure CSS kinetic current physics.
   Zero JS dependency. Zero piano system changes.
   Namespace: gw-mobile__snake-*
   ============================================ */

/* SNAKE PHYSICS TOKENS */
:root {
    --snake-duration: 5.2s;
    --snake-color: #14F195;
    --snake-glow: rgba(20, 241, 149, 0.65);
    --snake-afterglow: rgba(20, 241, 149, 0.18);
}

/* HERO CONDUCTOR — Positions the snake's path context.
   overflow: visible required — breaks through the mobile-main-wrapper
   overflow-x: hidden phantom layer that clips the ::before current line. */
.gw-mobile__snake-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
    overflow: visible !important;
}

/* Escalate overflow visibility up the parent chain to prevent clipping */
body.mobile-app.mobile-home .mobile-header-wrapper,
body.mobile-app.mobile-home .mobile-home-logo,
body.mobile-app.mobile-home .mobile-main-wrapper {
    overflow: visible !important;
}

/* EACH WORD NODE — The snake's waypoints */
.gw-mobile__snake-node {
    position: relative;
    display: inline-block;
}

/* THE SNAKE CURRENT LINE
   A luminous 1px line that sweeps left-to-right through each word.
   The staggered delay creates the illusion of a single current
   slithering top-to-bottom through the typography. */
.gw-mobile__snake-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: -5%;
    width: 0%;
    height: 1.5px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--snake-color) 30%,
        rgba(255, 255, 255, 0.9) 50%,
        var(--snake-color) 70%,
        transparent 100%
    );
    box-shadow:
        0 0 4px var(--snake-glow),
        0 0 10px var(--snake-glow),
        0 0 20px rgba(20, 241, 149, 0.3);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    animation: gw-snake-current var(--snake-duration) ease-in-out infinite;
}

/* THE TAIL AFTERIMAGE
   A low-opacity fading blur that lingers below the snake's path. */
.gw-mobile__snake-node::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--snake-afterglow), transparent);
    filter: blur(2px);
    z-index: 9;
    opacity: 0;
    pointer-events: none;
    animation: gw-snake-tail var(--snake-duration) ease-in-out infinite;
}

/* 
   GLITCH PIANO RHYTHM ENGINE - MOBILE OVERRIDE
   !important required to override custom.css .g-word animation !important rule.
*/
.g-word { animation: glitch-natural-shimmer 14.5s infinite !important; }
.g-icon { animation: glitch-icon-shimmer 18.2s infinite !important; }

.gw-1 { animation-delay: 0.13s !important; animation-duration: 13.1s !important; }
.gw-2 { animation-delay: 1.87s !important; animation-duration: 15.7s !important; }
.gw-3 { animation-delay: 3.41s !important; animation-duration: 12.3s !important; }
.gw-4 { animation-delay: 5.12s !important; animation-duration: 17.9s !important; }
.gw-5 { animation-delay: 0.76s !important; animation-duration: 14.2s !important; }
.gw-6 { animation-delay: 4.29s !important; animation-duration: 16.3s !important; }
.gw-7 { animation-delay: 2.15s !important; animation-duration: 13.7s !important; }
.gw-8 { animation-delay: 6.44s !important; animation-duration: 19.1s !important; }

/* WORD SPIKE
   Each word heats up (brightness + skew) as the snake passes through it,
   then cools back down to neutral white.
   !important required to override custom.css .g-word animation !important rule. */
.gw-mobile__snake-node > span {
    display: inline-block;
    animation: gw-snake-spike var(--snake-duration) ease-out infinite !important;
}

/* ============================================
   KEYFRAMES — The physics engine
   Active window per node: 0% → 12% of total cycle
   Remaining 88%: snake is elsewhere, word is cold
   ============================================ */

@keyframes gw-snake-current {
    0%   { left: -5%; width: 0%;    opacity: 0; }
    3%   { left: -2%; width: 15%;   opacity: 0.8; }
    7%   { left: 20%; width: 80%;   opacity: 1; }
    11%  { left: 95%; width: 10%;   opacity: 0.6; }
    13%  { left: 110%; width: 0%;   opacity: 0; }
    100% { left: -5%; width: 0%;    opacity: 0; }
}

@keyframes gw-snake-tail {
    0%   { opacity: 0; }
    6%   { opacity: 0; }
    9%   { opacity: 0.5; filter: blur(3px); }
    18%  { opacity: 0.15; filter: blur(5px); }
    28%  { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes gw-snake-spike {
    0%   { filter: none; transform: none; }
    4%   {
        filter: brightness(1.6) drop-shadow(0 0 6px var(--snake-glow));
        transform: skewX(2deg) scale(1.02);
    }
    8%   {
        filter: brightness(1.25) drop-shadow(0 0 3px var(--snake-afterglow));
        transform: skewX(0.5deg);
    }
    13%  { filter: none; transform: none; }
    100% { filter: none; transform: none; }
}

/* ============================================
   DELAY OFFSETS — The snake's route through the typography
   Staggered so the current appears to slither top → bottom.
   Total snake journey: 0s → 3.2s
   Silence (reset gap): 3.2s → 5.2s
   ============================================ */

/* Node 0 — "Welcome To" (Head enters here) */
.gw-mobile__snake-node--w0::before,
.gw-mobile__snake-node--w0::after,
.gw-mobile__snake-node--w0 > span {
    animation-delay: 0s !important;
    animation-duration: var(--snake-duration) !important;
}

/* Node 1 — "GLITCH" (dives off right edge of WELCOME) */
.gw-mobile__snake-node--w1::before,
.gw-mobile__snake-node--w1::after,
.gw-mobile__snake-node--w1 > span {
    animation-delay: 0.55s !important;
    animation-duration: var(--snake-duration) !important;
}

/* Node 2 — "WORLD" (re-emerges under GLITCH) */
.gw-mobile__snake-node--w2::before,
.gw-mobile__snake-node--w2::after,
.gw-mobile__snake-node--w2 > span {
    animation-delay: 1.0s !important;
    animation-duration: var(--snake-duration) !important;
}

/* Node 3 — "〽️" icon */
.gw-mobile__snake-node--w3::before,
.gw-mobile__snake-node--w3::after,
.gw-mobile__snake-node--w3 > span {
    animation-delay: 1.35s !important;
    animation-duration: var(--snake-duration) !important;
}

/* Node 4 — "Institutional-grade" */
.gw-mobile__snake-node--w4::before,
.gw-mobile__snake-node--w4::after,
.gw-mobile__snake-node--w4 > span {
    animation-delay: 1.8s !important;
    animation-duration: var(--snake-duration) !important;
}

/* Node 5 — "Cross-Chain" */
.gw-mobile__snake-node--w5::before,
.gw-mobile__snake-node--w5::after,
.gw-mobile__snake-node--w5 > span {
    animation-delay: 2.2s !important;
    animation-duration: var(--snake-duration) !important;
}

/* Node 6 — "token" */
.gw-mobile__snake-node--w6::before,
.gw-mobile__snake-node--w6::after,
.gw-mobile__snake-node--w6 > span {
    animation-delay: 2.55s !important;
    animation-duration: var(--snake-duration) !important;
}

/* Node 7 — "detection" */
.gw-mobile__snake-node--w7::before,
.gw-mobile__snake-node--w7::after,
.gw-mobile__snake-node--w7 > span {
    animation-delay: 2.9s !important;
    animation-duration: var(--snake-duration) !important;
}

/* Node 8 — "terminal" (Tail exits here, then silence before reset) */
.gw-mobile__snake-node--w8::before,
.gw-mobile__snake-node--w8::after,
.gw-mobile__snake-node--w8 > span {
    animation-delay: 3.2s !important;
    animation-duration: var(--snake-duration) !important;
}

/* Motion safety — Respect system accessibility settings */
@media (prefers-reduced-motion: reduce) {
    .gw-mobile__snake-node::before,
    .gw-mobile__snake-node::after,
    .gw-mobile__snake-node > span {
        animation: none !important;
    }
}
