/* ================================================
   HORUS MKT - APP SHELL (Android / WebView padrão)
   Ativado apenas quando <html> tem a classe "native-app"
   (adicionada por native-app.js rodando no Capacitor).
   Não afeta o site no navegador.
   ================================================ */

:root {
    --app-safe-top: env(safe-area-inset-top, 0px);
    --app-safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-safe-left: env(safe-area-inset-left, 0px);
    --app-safe-right: env(safe-area-inset-right, 0px);
    --app-tabbar-h: 58px;
    --app-gold: #D4AF37;
    --app-obsidian: #050505;
}

/* ---------- Comportamento de app nativo ---------- */
html.native-app,
html.native-app body {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: manipulation;
}

html.native-app body {
    min-height: 100dvh;
    overflow-x: hidden;
    padding-bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom)) !important;
    padding-left: var(--app-safe-left);
    padding-right: var(--app-safe-right);
}

/* Texto continua selecionável nos campos e em áreas marcadas */
html.native-app input,
html.native-app textarea,
html.native-app select,
html.native-app .selectable,
html.native-app .selectable * {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

/* Barra superior respeitando a status bar (notch) */
html.native-app nav[aria-label],
html.native-app header.app-topbar {
    padding-top: calc(var(--app-safe-top) + 8px) !important;
}

/* Evita rolagem horizontal / zoom acidental em imagens */
html.native-app img {
    -webkit-user-drag: none;
    pointer-events: none;
}
html.native-app a img,
html.native-app button img,
html.native-app .clickable img {
    pointer-events: auto;
}

/* Esconde o botão flutuante "miner" dentro do app (evita sobreposição) */
html.native-app .miner-btn,
html.native-app #miner-btn {
    display: none !important;
}

/* ---------- Barra de navegação inferior (tab bar) ---------- */
#app-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483000;
    display: none;
    grid-template-columns: repeat(5, 1fr);
    align-items: stretch;
    height: calc(var(--app-tabbar-h) + var(--app-safe-bottom));
    padding-bottom: var(--app-safe-bottom);
    padding-left: var(--app-safe-left);
    padding-right: var(--app-safe-right);
    margin: 0;
    box-sizing: border-box;
    background: rgba(5, 5, 5, 0.94);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
}

html.native-app #app-tabbar {
    display: grid;
}

#app-tabbar .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #8b8b8b;
    font-family: Manrope, system-ui, -apple-system, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    padding: 8px 2px;
    -webkit-user-select: none;
    user-select: none;
    transition: color 0.15s ease, transform 0.1s ease;
}

#app-tabbar .tab-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
}

#app-tabbar .tab-item:active {
    transform: scale(0.92);
}

#app-tabbar .tab-item.is-active {
    color: var(--app-gold);
}

#app-tabbar .tab-item.is-active svg {
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.55));
}

/* O botão central (ação) levemente destacado */
#app-tabbar .tab-item.tab-center {
    color: #b9b9b9;
}
#app-tabbar .tab-item.tab-center svg {
    width: 24px;
    height: 24px;
}

/* Tela de abertura nativa (fallback caso o splash do plugin não apareça) */
#app-boot {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--app-obsidian);
    transition: opacity 0.35s ease;
}
html.native-app #app-boot {
    display: flex;
}
html.native-app.app-ready #app-boot {
    opacity: 0;
    pointer-events: none;
}
#app-boot .boot-mark {
    font-family: Cinzel, serif;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    color: var(--app-gold);
    opacity: 0.9;
    animation: appBootPulse 1.4s ease-in-out infinite;
}
@keyframes appBootPulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}
