﻿/* ✅ BALÃO DE KM TOTAL - Fixo na tela */
#km-total-container {
    position: fixed;
    /* Cálculo: O top da lua (50px) + Metade da altura da lua (35px) - Metade da altura do balão (~18px) */
    top: 67px;
    /* Cálculo: O left da lua (8px) + Largura da lua (70px) + Espaçamento (15px) */
    left: 93px;
    z-index: 1000;
    pointer-events: none;
    margin-top: -9px;
}

#km-total-badge {
    background: #333333;
    border-radius: 16px;
    padding: 8px 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    font-size: 14px;
    pointer-events: auto;
    /* ✅ NOVAS REGRAS AQUI */
    max-width: 130px; /* Limita a largura para não bater no balão da direita */
    white-space: normal; /* Permite que o texto quebre em duas linhas */
    text-align: center; /* Centraliza o texto se quebrar */
    line-height: 1.2; /* Ajusta o espaçamento entre as linhas */
    flex-direction: column; /* Força o emoji e o texto a ficarem um embaixo do outro se precisar */
}

/*   #km-total-badge {
            background: #333333;
            border-radius: 16px;
            padding: 8px 14px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.25);
            display: flex;
            align-items: center;
            gap: 6px;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255,255,255,0.2);
            color: #ffffff;
            font-size: 14px;
            pointer-events: auto; 
            white-space: nowrap; 
        } */

/* ✅ Ajustes para Celulares */
@media (max-width: 768px) {
    #km-total-container {
        /* Lua no celular: top 44px, tamanho 53px, left 5px */
        top: 58px;
        left: 70px; /* 5px (left) + 53px (lua) + 12px (espaço) */
    }

    #km-total-badge {
        padding: 6px 10px;
        font-size: 13px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    #km-total-container {
        /* Lua no celular pequeno: top 44px, tamanho 45px, left 5px */
        top: 55px;
        left: 58px; /* 5px (left) + 45px (lua) + 8px (espaço) */
    }

    #km-total-badge {
        padding: 5px 8px;
        font-size: 12px;
    }
}

/* Ajuste Específico para iOS (Safari) */
@supports (-webkit-touch-callout: none) {
    #km-total-container {
        top: 67px; /* Mantém o mesmo alinhamento no iPhone */
    }
}


/* ============================================ BARRA DE PROGRESSO ============================================ */
#refresh-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: #00ff00; /* Verde neon */
    width: 0%;
    z-index: 99999;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.5s ease;
    box-shadow: 0 0 10px #00ff00;
}

/* ============================================
                   MARCADOR DE FOTO DO USUÁRIO (DIV ICON)
                   ============================================ */
.custom-user-marker {
    background: transparent;
    border: none;
}

.user-marker-wrapper {
    position: relative;
    width: 50px;
    height: 60px;
}

.user-marker-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #007AFF; /* Borda azul estilo iOS */
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    overflow: hidden; /* Garante que nada escapes para fora do círculo */
    background: #fff; /* Fundo branco caso a foto demore a carregar */
    display: flex;
    align-items: center;
    justify-content: center;
}

    .user-marker-circle img {
        width: 100%;
        height: 100%;
        /* ✅ A PROPRIEDADE MÁGICA AQUI */
        object-fit: cover;
        border-radius: 50%; /* Garante que a própria imagem fique arredondada nas pontas */
        display: block; /* Remove espaços em branco indesejados embaixo da imagem */
    }

.user-marker-arrow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid #0C95FF; /* Pontinha azul */
}

/* ============================================
                  RESET UNIVERSAL
        ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: none;
    position: relative;
}

/* FIX PARA iOS */
@supports (-webkit-touch-callout: none) {
    html, body {
        height: -webkit-fill-available !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        overflow: hidden !important;
    }
}

/* ============================================
                   LAYOUT PRINCIPAL
                   ============================================ */
.themebody-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #000;
    position: relative;
}

@supports (-webkit-touch-callout: none) {
    .themebody-wrap {
        height: -webkit-fill-available !important;
        min-height: -webkit-fill-available !important;
    }
}

.theme-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.container-fluid {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0;
}

.row {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 !important;
    min-height: 0;
}

.col-md-12 {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
    min-height: 0;
}

.card {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    min-height: 0;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0;
}

/* ============================================
                   MAPA
                   ============================================ */
#map {
    flex: 1;
    width: 100%;
    min-height: 0;
    position: relative;
    z-index: 1;
    background: #1a1a2e;
}

.leaflet-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
}

/* ============================================
                   WEATHER BANNER
                   ============================================ */
#weather-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #333;
    color: #fff;
    font-weight: 700;
    padding: 8px 0;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    min-height: 36px;
    height: auto;
    flex-shrink: 0;
    font-size: 14px;
}

@supports (-webkit-touch-callout: none) {
    #weather-banner {
        min-height: 44px !important;
        padding: 10px 0 !important;
    }
}

#weather-description {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: 0 1px 5px rgba(0,0,0,0.9) !important;
    font-weight: 700 !important;
    font-size: 15px;
}

/* ============================================
                   COUNTER CONTAINER - RODAPÉ
                   ============================================ */
#counter-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #333;
    text-align: center;
    z-index: 2000;
    padding: 6px 0;
    padding-bottom: env(safe-area-inset-bottom);
    padding-bottom: constant(safe-area-inset-bottom);
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

@supports (-webkit-touch-callout: none) {
    #counter-container {
        padding: 4px 0 !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
        padding-bottom: constant(safe-area-inset-bottom) !important;
        min-height: 44px !important;
    }
}

#endereco-display {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: 0 1px 5px rgba(0,0,0,0.9) !important;
    text-align: center;
    padding: 2px 8px;
    line-height: 1.3;
    word-wrap: break-word;
    max-width: 100%;
}

#online-counter {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: 0 1px 5px rgba(0,0,0,0.9) !important;
    font-weight: 900 !important;
    font-size: 15px;
    display: inline-block;
    padding: 0px 0px 0px 16px;
    /*padding: 4px 8px 4px 16px;*/
}

#km-display {
    color: #33ff33 !important;
    -webkit-text-fill-color: #33ff33 !important;
    text-shadow: 0 0 10px rgba(0,255,0,0.3), 0 1px 5px rgba(0,0,0,0.9) !important;
    font-weight: 900 !important;
    font-size: 15px;
    display: inline-block;
    padding: 4px 16px 4px 0;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: background 0.2s;
    line-height: 1;
    margin-left: 4px;
}

    .help-icon:hover {
        background: #ccc;
    }

    .help-icon:active {
        transform: scale(0.9);
    }

/* ============================================
                   SPEED BALLOON - TOPO DIREITO
                           rgba(255,255,255,0.96);
                   ============================================ */
#speed-balloon {
    position: fixed;
    top: 46px;
    right: 8px;
    background: #333333;
    color: #333;
    padding: 10px 14px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    font-weight: 600;
    font-size: 14px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 88%;
    min-width: 150px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
}

@supports (-webkit-touch-callout: none) {
    #speed-balloon {
        top: 50px !important;
        right: 6px !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-width: 130px !important;
    }
}

/* LINHAS DO BALÃO */
.battery-row,
.accuracy-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

    .battery-row.horizontal,
    .accuracy-row.horizontal {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 14px;
    }

.battery-item,
.accuracy-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ÍCONES DO BALÃO */
#battery-icon,
#rede-icon,
#accuracy-icon,
#interval-icon,
#timestamp-icon,
#speed-icon {
    font-size: 17px;
}

/* TEXTOS DO BALÃO */
#battery-display,
#rede-display,
#accuracy-display,
#interval-display,
#timestamp-display,
#speed-display {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #FFFFFF;
}

.battery-percentage,
.gp,
.it {
    font-size: 1.1em;
    font-weight: 700;
    color: #FFFFFF;
}

.speed-row {
    display: none;
}

/* ============================================
                   BOTÕES FLUTUANTES
                   ============================================ */
.floating-icons {
    display: flex;
    flex-direction: row;
    gap: 5px;
    margin-bottom: 4px;
    width: 100%;
}

.floating-icon {
    font-size: 17px;
    cursor: pointer;
    background-color: #1E3A5F;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    border: none;
    padding: 0;
}

    .floating-icon:hover {
        background-color: #0056b3;
        transform: scale(1.1);
    }

    .floating-icon:active {
        transform: scale(0.9);
    }

/* ============================================
                   MOON PHASE
                   ============================================ */
#moon-phase {
    position: fixed;
    top: 50px;
    left: 8px;
    z-index: 1000;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5));
}

#moon-emoji {
    width: 70px;
    height: 70px;
    transition: filter 1s ease, transform 1s ease;
    display: block;
}

@supports (-webkit-touch-callout: none) {
    #moon-phase {
        top: 50px !important;
        left: 6px !important;
    }

    #moon-emoji {
        width: 56px !important;
        height: 56px !important;
    }
}

/* Brilho da Lua */
#moon-emoji.full {
    animation: brilhoIntenso 3s infinite alternate;
}

@keyframes brilhoIntenso {
    0% {
        filter: drop-shadow(0 0 15px #fff) drop-shadow(0 0 30px #ffd700);
        transform: scale(1);
    }

    100% {
        filter: drop-shadow(0 0 30px #fff) drop-shadow(0 0 60px #ffd700);
        transform: scale(1.06);
    }
}

#moon-emoji.young,
#moon-emoji.waxing_crescent,
#moon-emoji.waxing_quarter {
    filter: drop-shadow(0 0 6px #fff2) drop-shadow(0 0 12px #fffa);
    transform: scale(1.00);
}

#moon-emoji.waxing_gibbous,
#moon-emoji.full,
#moon-emoji.waning_gibbous {
    filter: drop-shadow(0 0 10px #fff6) drop-shadow(0 0 25px #ffd700cc);
}

#moon-emoji.waning_quarter,
#moon-emoji.waning_crescent,
#moon-emoji.old {
    filter: drop-shadow(0 0 6px #fff2) drop-shadow(0 0 10px #ffd70055);
    transform: scale(0.98);
}

/* ============================================
                   BOTÕES DE EXPORTAÇÃO
                   ============================================ */
#export-buttons {
    position: fixed;
    bottom: 70px;
    left: 10px;
    z-index: 1000;
    display: flex;
    gap: 6px;
    padding-bottom: env(safe-area-inset-bottom);
    padding-bottom: constant(safe-area-inset-bottom);
}

.export-btn.icon-only {
    width: 56px;
    height: 56px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .export-btn.icon-only img.export-icon {
        width: 32px;
        height: 32px;
        object-fit: contain;
        user-select: none;
        pointer-events: none;
        transition: transform 0.25s ease;
    }

    .export-btn.icon-only:active {
        transform: scale(0.9);
    }

    .export-btn.icon-only:hover {
        background: rgba(0,122,255,0.9);
        border-color: #007AFF;
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 8px 30px rgba(0,122,255,0.4);
    }

        .export-btn.icon-only:hover img.export-icon {
            transform: scale(1.15);
        }

@supports (-webkit-touch-callout: none) {
    #export-buttons {
        bottom: 60px !important;
        left: 6px !important;
        gap: 4px !important;
    }

    .export-btn.icon-only {
        width: 48px !important;
        height: 48px !important;
    }

        .export-btn.icon-only img.export-icon {
            width: 26px !important;
            height: 26px !important;
        }
}

/* BOTÃO ALTITUDE */
#altitude-trend-btn {
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.15);
}

#altitude-trend-emoji {
    font-size: 26px;
    display: inline-block;
    transition: transform 0.2s ease;
}

    #altitude-trend-emoji:hover {
        transform: scale(1.2);
    }



/* ============================================
                   TEXTO FLUTUANTE DE VELOCIDADE
                   ============================================ */
.speed-text {
    position: absolute;
    background: rgba(20, 70, 90, 0.85);
    color: #fff;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    pointer-events: none;
    z-index: 1000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: left 0.3s ease, top 0.3s ease;
}

    .speed-text::after {
        content: "";
        position: absolute;
        bottom: -14px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 14px solid rgba(20, 70, 90, 0.85);
    }

#current-speed-display {
    display: inline-block;
    font-weight: 700;
}

/* ============================================
                   RECAPTCHA
                   ============================================ */
.grecaptcha-badge {
    bottom: 80px !important;
    z-index: 9998 !important;
}

/* ============================================
                   RESPONSIVIDADE
                   ============================================ */
@media (max-width: 768px) {
    #weather-banner {
        font-size: 1px;
        padding: 6px 0;
        min-height: 32px;
    }

    #weather-description {
        font-size: 14px;
    }

    #speed-balloon {
        top: 40px;
        right: 5px;
        padding: 8px 10px;
        font-size: 13px;
        min-width: 120px;
    }

    #battery-display,
    #rede-display,
    #accuracy-display,
    #interval-display,
    #timestamp-display,
    #speed-display {
        font-size: 13px;
    }

    #battery-icon,
    #rede-icon,
    #accuracy-icon,
    #interval-icon,
    #timestamp-icon,
    #speed-icon {
        font-size: 16px;
    }

    #moon-phase {
        top: 44px;
        left: 5px;
    }

    #moon-emoji {
        width: 53px;
        height: 53px;
    }

    #export-buttons {
        bottom: 55px;
        left: 5px;
        gap: 4px;
    }

    .export-btn.icon-only {
        width: 46px;
        height: 46px;
    }

        .export-btn.icon-only img.export-icon {
            width: 26px;
            height: 26px;
        }

    #online-counter,
    #km-display {
        font-size: 14px;
    }

    #endereco-display {
        font-size: 14px !important;
    }

    .speed-text {
        font-size: 14px;
        padding: 4px 10px;
    }

    .floating-icon {
        width: 26px;
        height: 26px;
        font-size: 16px;
    }

    #altitude-trend-btn {
        min-width: 44px;
        min-height: 44px;
    }

    #altitude-trend-emoji {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    #weather-description {
        font-size: 13px;
    }
    /* ===== ESPAÇO EXTRA PARA ANDROID ===== */
    @media (max-width: 768px) and (pointer: coarse) {
        #export-buttons {
            bottom: 65px !important;
            left: 8px !important;
            gap: 5px !important;
        }

        .export-btn.icon-only {
            width: 50px !important;
            height: 50px !important;
        }

            .export-btn.icon-only img.export-icon {
                width: 28px !important;
                height: 28px !important;
            }
    }

    #speed-balloon {
        top: 38px;
        right: 4px;
        padding: 6px 8px;
        font-size: 12px;
        min-width: 100px;
    }

    #battery-display,
    #rede-display,
    #accuracy-display,
    #interval-display,
    #timestamp-display,
    #speed-display {
        font-size: 12px;
    }

    #battery-icon,
    #rede-icon,
    #accuracy-icon,
    #interval-icon,
    #timestamp-icon,
    #speed-icon {
        font-size: 14px;
    }

    #moon-emoji {
        width: 45px;
        height: 45px;
    }

    #export-buttons {
        bottom: 50px;
        left: 4px;
        gap: 3px;
    }

    .export-btn.icon-only {
        width: 40px;
        height: 40px;
    }

        .export-btn.icon-only img.export-icon {
            width: 22px;
            height: 22px;
        }

    #online-counter,
    #km-display {
        font-size: 13px;
    }

    #endereco-display {
        font-size: 13px !important;
    }

    .speed-text {
        font-size: 12px;
        padding: 7px 13px;
    }

    .floating-icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    #altitude-trend-btn {
        min-width: 38px;
        min-height: 38px;
    }

    #altitude-trend-emoji {
        font-size: 20px;
    }

    .grecaptcha-badge {
        bottom: 70px !important;
    }
}




/* ============================================
           FORÇAR NEGRITO EM TODOS OS TAMANHOS
           ============================================ */
@media (max-width: 768px) {
    #weather-description {
        font-weight: 900 !important;
        -webkit-text-stroke: 0.3px rgba(255,255,255,0.3) !important;
    }

    #endereco-display {
        font-weight: 900 !important;
        -webkit-text-stroke: 0.3px rgba(255,255,255,0.1) !important;
    }

    #online-counter {
        font-weight: 900 !important;
    }

    #km-display {
        font-weight: 900 !important;
    }

    .battery-percentage,
    .gp,
    .it {
        font-weight: 900 !important;
        -webkit-text-stroke: 0.2px rgba(0,0,0,0.2) !important;
    }

    #battery-display,
    #rede-display,
    #accuracy-display,
    #interval-display,
    #timestamp-display,
    #speed-display {
        font-weight: 700 !important;
    }
}

/* ============================================
           GARANTIR NEGRITO EM CELULARES
           ============================================ */
@media (max-width: 480px) {
    #weather-description {
        font-weight: 900 !important;
        font-size: 13px !important;
        -webkit-text-stroke: 0.5px rgba(255,255,255,0.2) !important;
    }

    #endereco-display {
        font-weight: 900 !important;
        font-size: 13px !important;
        -webkit-text-stroke: 0.3px rgba(255,255,255,0.1) !important;
    }

    #online-counter {
        font-weight: 900 !important;
        font-size: 13px !important;
    }

    #km-display {
        font-weight: 900 !important;
        font-size: 13px !important;
    }

    .battery-percentage,
    .gp,
    .it {
        font-weight: 900 !important;
        -webkit-text-stroke: 0.3px rgba(0,0,0,0.3) !important;
    }

    #battery-display,
    #rede-display,
    #accuracy-display,
    #interval-display,
    #timestamp-display,
    #speed-display {
        font-weight: 700 !important;
        font-size: 12px !important;
    }
}

/* ============================================
           PERFIL DO USUÁRIO - PADRÃO (ANDROID)
                   gba(255,255,255,0.96);
           ============================================ */
#user-profile-container {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 147px); /* ← AJUSTE AQUI SE PRECISAR */
    right: 8px;
    z-index: 10000;
    background: #333333;
    border-radius: 16px;
    padding: 3px 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    display: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    min-width: auto; /* ← REMOVE LARGURA MÍNIMA FIXA */
    width: auto; /* ← AJUSTA AO CONTEÚDO */
    max-width: 220px; /* ← LIMITE MÁXIMO PARA NÃO FICAR GIGANTE */
}

#user-profile-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: auto; /* ← AJUSTA AO CONTEÚDO */
}

#user-avatar-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #007AFF;
    overflow: hidden;
    background: #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

#user-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#user-name-display {
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
    white-space: nowrap; /* ← NÃO QUEBRA LINHA */
    max-width: 100%; /* ← USA O LIMITE DO CONTAINER */
    overflow: visible; /* ← MOSTRA TUDO */
    text-overflow: clip; /* ← SEM "..." */
    display: inline-block; /* ← AJUSTA AO TEXTO */
}

/* ============================================
           AJUSTE UNIVERSAL PARA TELAS PEQUENAS
           ============================================ */
@media (max-width: 480px) {
    #user-profile-container {
        top: calc(env(safe-area-inset-top, 0px) + 122px);
        right: 4px;
        padding: 6px 10px;
        border-radius: 12px;
        min-width: auto; /* ← REMOVE LARGURA MÍNIMA FIXA */
        width: auto; /* ← AJUSTA AO CONTEÚDO */
        max-width: 180px; /* ← LIMITE MÁXIMO */
    }

    #user-avatar-wrapper {
        width: 44px;
        height: 44px;
        border-width: 2px;
    }

    #user-name-display {
        font-size: 11px; /* ← UM POUCO MAIOR PARA LEGIBILIDADE */
        font-weight: 600;
        max-width: 100%;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        display: inline-block;
    }

    #user-profile-inner {
        gap: 4px;
        width: auto;
    }
}

@media (max-width: 380px) {
    #user-profile-container {
        top: calc(env(safe-area-inset-top, 0px) + 122px);
        padding: 4px 8px;
        min-width: auto;
        width: auto;
        max-width: 150px;
        border-radius: 10px;
    }

    #user-avatar-wrapper {
        width: 36px;
        height: 36px;
    }

    #user-name-display {
        font-size: 10px;
        font-weight: 600;
        max-width: 100%;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        display: inline-block;
    }

    #user-profile-inner {
        gap: 2px;
        width: auto;
    }
}

/* ============================================
           AJUSTE EXCLUSIVO PARA IPHONE - ABATER O BALÃO
           ============================================ */
@supports (-webkit-touch-callout: none) {
    #user-profile-container {
        top: calc(env(safe-area-inset-top, 0px) + 135px) !important;
        right: 4px !important;
        padding: 6px 12px !important; /* ← MAIS ESPAÇO LATERAL */
        min-width: auto !important; /* ← REMOVE LARGURA MÍNIMA FIXA */
        width: auto !important; /* ← AJUSTA AUTOMATICAMENTE */
        max-width: 200px !important; /* ← LIMITE MÁXIMO (OPCIONAL) */
        border-radius: 12px !important;
    }
    /* ✅ NOME COMPLETO SEM "..." E SEM QUEBRA */
    #user-name-display {
        font-size: 12px !important; /* ← UM POUCO MAIOR */
        font-weight: 600 !important;
        max-width: none !important; /* ← REMOVE LIMITE DE LARGURA */
        white-space: nowrap !important; /* ← NÃO QUEBRA LINHA */
        overflow: visible !important; /* ← MOSTRA TUDO */
        text-overflow: clip !important; /* ← REMOVE O "..." */
        word-break: keep-all !important;
        display: inline-block !important; /* ← AJUSTA AO TEXTO */
    }

    #user-profile-inner {
        gap: 4px !important;
        width: auto !important; /* ← AJUSTA AUTOMATICAMENTE */
    }
    /* AVATAR MANTÉM TAMANHO */
    #user-avatar-wrapper {
        width: 44px !important;
        height: 44px !important;
        border-width: 2px !important;
        flex-shrink: 0 !important;
    }
}


/* AVISOS */
.avisos-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.avisos-card {
    background: #F0F1F2;
    border: 1px solid #232B36;
    border-radius: 14px;
    max-width: 340px;
    width: 100%;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.55);
    animation: avisosFadeIn 0.15s ease-out;
}

@keyframes avisosFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avisos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.avisos-titulo {
    font-size: 17px;
    font-weight: 700;
    color: #000000;
}

.avisos-fechar {
    background: none;
    border: none;
    color: #8A94A3;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.avisos-corpo {
    color: #000000;
    font-size: 14px;
    line-height: 1.5;
}

    .avisos-corpo .subtitulo {
        font-weight: 700;
        color: #000000;
        font-size: 15px;
        margin-bottom: 8px;
        display: block;
    }

.avisos-btn-primario {
    margin-top: 16px;
    width: 100%;
    background: #1976D2;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

    .avisos-btn-primario:disabled {
        opacity: 0.6;
        cursor: default;
    }

.avisos-btn-secundario {
    margin-top: 10px;
    width: 100%;
    background: #1976D2;
    color: #C7CDD6;
    border: 1px solid #2A323D;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
}

 