/* PWA / modo app mobile - Era dos Impérios */
.edi-pwa-install-home,
.edi-mobile-bottom-nav {
    display: none;
}

.edi-install-app-button[hidden] {
    display: none !important;
}

.edi-install-app-button {
    border: 1px solid rgba(185,141,66,.95);
    border-radius: 8px;
    background: linear-gradient(to bottom, #cda43b 0%, #8a5d10 100%);
    color: #fff7d6;
    font: bold 12px Verdana, Arial, sans-serif;
    padding: 9px 12px;
    cursor: pointer;
    text-shadow: 1px 1px 1px #3f2b04;
}

.edi-install-app-button:hover {
    background: linear-gradient(to bottom, #d9b94a 0%, #9b6c14 100%);
}

@media (max-width: 820px) {
    body.edi-home-page,
    body.edi-login-page {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        overflow-x: hidden !important;
        background-color: #efe8c8 !important;
        -webkit-text-size-adjust: 100%;
        touch-action: pan-x pan-y pinch-zoom;
    }

    body.edi-home-page > table:first-of-type,
    body.edi-login-page > table:first-of-type {
        transform-origin: top left;
        -webkit-transform-origin: top left;
    }

    .edi-pwa-install-home {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        box-sizing: border-box;
        width: 100%;
        padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
        background: #20150f;
        border-bottom: 2px solid #b98d42;
        color: #f7e6b7;
        font: bold 13px Verdana, Arial, sans-serif;
        box-shadow: 0 2px 8px rgba(0,0,0,.35);
    }

    .edi-pwa-install-home span {
        display: block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    body.edi-game-page {
        padding-bottom: 64px !important;
    }

    body.edi-game-page .edi-mobile-nav {
        padding-top: calc(8px + env(safe-area-inset-top));
    }

    body.edi-game-page .edi-mobile-nav .edi-install-app-button {
        width: 100%;
        margin: 0 0 7px 0;
    }

    .edi-mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed;
        z-index: 10000;
        left: 0;
        right: 0;
        bottom: 0;
        box-sizing: border-box;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        background: rgba(32, 21, 15, .97);
        border-top: 2px solid #b98d42;
        box-shadow: 0 -2px 10px rgba(0,0,0,.35);
        gap: 5px;
    }

    .edi-mobile-bottom-nav a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        padding: 4px 3px;
        border: 1px solid rgba(185,141,66,.45);
        border-radius: 7px;
        background: #efe2b9;
        color: #5c1b12 !important;
        text-align: center;
        text-decoration: none !important;
        font: bold 10px Verdana, Arial, sans-serif;
        line-height: 1.15;
    }

    .edi-mobile-bottom-nav a:hover,
    .edi-mobile-bottom-nav a:active {
        background: #fff5d5;
        color: #7b1d12 !important;
    }
}

@media (display-mode: standalone) {
    .edi-pwa-install-home,
    .edi-install-app-button {
        display: none !important;
    }
}


/* Ajuste global: fontes maiores no celular para atalhos/PWA. */
@media (max-width: 820px) {
    .edi-pwa-install-home {
        font-size: 15px !important;
        line-height: 1.25 !important;
    }

    .edi-install-app-button {
        font-size: 14px !important;
        min-height: 38px !important;
        padding: 10px 12px !important;
    }

    .edi-mobile-bottom-nav a {
        font-size: 12px !important;
        line-height: 1.18 !important;
        min-height: 44px !important;
        padding: 5px 3px !important;
    }
}

/* Botao fixo de instalacao exibido somente dentro do jogo no celular. */
.edi-download-app-fixed,
.edi-install-help {
    display: none;
}

@media (max-width: 820px) {
    body.edi-game-page .edi-download-app-fixed {
        display: block;
        position: fixed;
        z-index: 10002;
        right: 10px;
        bottom: calc(66px + env(safe-area-inset-bottom));
        width: auto;
        min-width: 126px;
        margin: 0;
        padding: 11px 14px !important;
        border-radius: 999px;
        box-shadow: 0 3px 12px rgba(0,0,0,.38);
        font-size: 14px !important;
    }

    body.edi-game-page .edi-install-help[hidden],
    body.edi-game-page .edi-download-app-fixed[hidden] {
        display: none !important;
    }

    body.edi-game-page .edi-install-help {
        position: fixed;
        z-index: 10020;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        padding: 18px;
        background: rgba(24, 15, 10, .78);
    }

    body.edi-game-page .edi-install-help-card {
        position: relative;
        box-sizing: border-box;
        width: 100%;
        max-width: 390px;
        padding: 22px 18px 18px;
        border: 2px solid #b98d42;
        border-radius: 12px;
        background: #fff5d5;
        color: #3c2717;
        font: 15px/1.5 Verdana, Arial, sans-serif;
        box-shadow: 0 10px 30px rgba(0,0,0,.45);
    }

    body.edi-game-page .edi-install-help-card strong {
        display: block;
        margin: 0 34px 10px 0;
        color: #5c1b12;
        font-size: 18px;
    }

    body.edi-game-page .edi-install-help-card p {
        margin: 0 0 16px;
        font-size: 15px;
    }

    body.edi-game-page .edi-install-help-close {
        position: absolute;
        top: 7px;
        right: 8px;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #5c1b12;
        font: bold 28px/36px Arial, sans-serif;
        cursor: pointer;
    }

    body.edi-game-page .edi-install-help-ok {
        width: 100%;
        min-height: 42px;
        border: 1px solid #70470e;
        border-radius: 8px;
        background: #8a5d10;
        color: #fff7d6;
        font: bold 15px Verdana, Arial, sans-serif;
        cursor: pointer;
    }
}

@media (display-mode: standalone) {
    .edi-download-app-fixed,
    .edi-install-help {
        display: none !important;
    }
}
