/* ========================================================================== */
/* 3142.in MASTER ANDROID-FIRST DESIGN TOKENS & MOBILE APPLICATION SHELL       */
/* Designed per Master Implementation Specification                           */
/* ========================================================================== */

:root {
    /* 1. Core Cyber-Dark STEM Palette */
    --app-bg: #070A14;
    --app-bg-secondary: #0B1020;
    --app-surface: #111827;
    --app-surface-elevated: #172033;
    --app-border: #283449;
    --app-border-subtle: rgba(40, 52, 73, 0.6);

    /* 2. Brand & Semantic Accent Colors */
    --app-cyan: #22D3EE;
    --app-cyan-glow: rgba(34, 211, 238, 0.25);
    --app-violet: #8B5CF6;
    --app-violet-glow: rgba(139, 92, 246, 0.25);
    --app-amber: #FBBF24;
    --app-amber-glow: rgba(251, 191, 36, 0.25);
    --app-emerald: #34D399;
    --app-rose: #FB7185;

    /* 3. Text System */
    --app-text-primary: #F8FAFC;
    --app-text-secondary: #94A3B8;
    --app-text-muted: #64748B;

    /* 4. Elevation, Radius & Insets */
    --app-radius-sm: 10px;
    --app-radius-md: 14px;
    --app-radius-lg: 18px;
    --app-radius-xl: 24px;
    --app-nav-height: 64px;
}

/* Base Mobile App Viewport & Overscroll Containment */
html, body {
    background-color: var(--app-bg) !important;
    color: var(--app-text-primary) !important;
    overscroll-behavior-y: auto !important;
    overscroll-behavior-x: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif !important;
}

/* Eliminate All Web Browser Scrollbars */
html, body, div, main, section, nav, aside {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Touch targets & 0ms Tap Latency */
button, a, input, select, textarea, [role="button"], .interactive-card, nav {
    touch-action: manipulation !important;
}

nav, button, .select-none, .game-tab, #mobile-bottom-nav, footer {
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* Surface Cards & Containers */
.app-surface-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: transform 180ms cubic-bezier(0, 0, 0.2, 1), border-color 180ms ease, box-shadow 180ms ease;
}

.app-surface-elevated {
    background: var(--app-surface-elevated);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

.app-surface-card:active {
    transform: scale(0.985);
}

/* Featured Shutter Button (Snap & Solve Hero) */
.app-shutter-btn {
    background: linear-gradient(135deg, var(--app-cyan) 0%, var(--app-violet) 100%);
    box-shadow: 0 0 24px var(--app-cyan-glow), 0 8px 32px rgba(139, 92, 246, 0.35);
    transition: transform 160ms cubic-bezier(0, 0, 0.2, 1), box-shadow 160ms ease;
}
.app-shutter-btn:active {
    transform: scale(0.94);
    box-shadow: 0 0 12px var(--app-cyan-glow);
}

/* Material Ink Touch Ripple */
.native-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: native-ripple-anim 0.38s cubic-bezier(0.1, 0.7, 0.1, 1) forwards;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.38) 0%, rgba(139, 92, 246, 0.15) 70%, transparent 100%);
    pointer-events: none;
    z-index: 99;
}
@keyframes native-ripple-anim {
    to {
        transform: scale(3.5);
        opacity: 0;
    }
}

/* View Transitions (Instant 0ms Native App Transitions) */
@keyframes native-slide-in {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes native-slide-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-20px); opacity: 0; }
}
::view-transition-old(root) {
    animation: 140ms cubic-bezier(0.4, 0, 1, 1) both native-slide-out;
}
::view-transition-new(root) {
    animation: 180ms cubic-bezier(0, 0, 0.2, 1) both native-slide-in;
}

/* Safe Bottom Inset Padding (ensures fixed bottom nav never blocks content) */
main {
    padding-bottom: max(6.5rem, calc(5.5rem + env(safe-area-inset-bottom))) !important;
}

/* Filter Chips (Question Vault & Game Categories) */
.app-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.45rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    color: var(--app-text-secondary);
    transition: all 160ms cubic-bezier(0, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
}
.app-filter-chip.active {
    background: rgba(34, 211, 238, 0.12);
    border-color: var(--app-cyan);
    color: var(--app-cyan);
    box-shadow: 0 0 12px var(--app-cyan-glow);
}
.app-filter-chip:active {
    transform: scale(0.95);
}

/* Responsive Hide/Show for Mobile App vs Desktop */
@media (max-width: 768px) {
    .site-desktop-footer {
        display: none !important;
    }
    .desktop-only-header {
        display: none !important;
    }
    .mobile-app-header {
        display: flex !important;
    }
}
@media (min-width: 769px) {
    .mobile-app-header {
        display: none !important;
    }
}
