/* ═══════════════════════════════════════════════════════════
 * navbar.css — Navbar compartilhada (game, shop, wallet)
 * ═══════════════════════════════════════════════════════════
 *
 * Depende das CSS variables definidas em game.css:
 *   --bg, --bg-nav, --bg-panel, --border, --bored (gold),
 *   --pink, --green, --cyan, --nav-h
 *
 * Como usar:
 *   <link rel="stylesheet" href="/css/game.css">
 *   <link rel="stylesheet" href="/css/navbar.css">
 *
 *   <nav id="navbar">...</nav>
 * ═══════════════════════════════════════════════════════════ */

/* ── Garante variáveis fundamentais caso a página não importe game.css ── */
:root {
    --nav-h: 80px;
    --bg-nav: var(#141620);
    --bored: var(#bfc500);
    --bg-panel: var(--bg-panel, #141620);
}

/* ── NAV CENTER (pool selector + icon buttons) ── */
.nav-center {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

/* ── Pool selector compacto ── */
.nav-pool-selector {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-pool-btn {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color .15s, background .15s;
    font-family: inherit;
    color: #fff;
}
.nav-pool-btn:hover {
    border-color: rgba(255, 215, 0, .4);
    background: rgba(197, 197, 0, .06);
}
.nav-pool-btn img { width: 28px; height: 28px; flex-shrink: 0; }

.nav-pool-symbol {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
}
.nav-pool-balance {
    font-family: 'Share Tech Mono', monospace;
    font-size: 15px;
    color: var(--bored);
    white-space: nowrap;
}
.nav-pool-block {
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    color: var(--bored);
    white-space: nowrap;
}
.nav-pool-block-lbl {
    font-size: 11px;
    color: rgba(255, 255, 255, .7);
    letter-spacing: .1em;
}
.nav-pool-caret {
    color: rgba(255, 255, 255, .4);
    font-size: 9px;
    flex-shrink: 0;
}
.nav-pool-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    z-index: 110;
    background: var(--bg, #0c0e1b);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .6);
    min-width: 200px;
}
.nav-pool-option {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background .15s;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.nav-pool-option:last-child { border-bottom: none; }
.nav-pool-option:hover { background: rgba(255, 255, 255, .04); }

/* ── Icon buttons (SHOP, WALLET) ── */
.nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}
.nav-icon-btn:hover {
    border-color: rgba(255, 215, 0, .4);
    background: rgba(197, 197, 0, .08);
    transform: translateY(-1px);
    filter: brightness(0) invert(1);
}

/* Quando a navbar marca a aba atual (active), destaca o ícone */
.nav-icon-btn.active {
    border-color: var(--border);
    background: var(--border);
    box-shadow: 0 0 5px var(--border);
    filter: brightness(0) invert(1);
}

/* ── Hamburger (mobile) ── */
.nav-burger {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 16px;
    color: #fff;
    margin-left: auto;
}
.nav-burger:hover {
    border-color: rgba(255, 215, 0, .4);
    background: rgba(197, 197, 0, .08);
}

/* ── MOBILE RESPONSIVENESS ── */
@media (max-width: 900px) {
    #navbar { padding: 0 12px; gap: 8px; }
    .nav-center { gap: 8px; }
    .nav-pool-block,
    .nav-pool-block-lbl { display: none; }
    .nav-pool-balance { font-size: 12px; }
    .logo-text { font-size: 16px; }
}

@media (max-width: 600px) {
    .nav-profile > div:first-child {
        display: none !important;
    }
    .nav-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .nav-pool-btn {
        padding: 5px 8px;
        gap: 6px;
    }
    .nav-pool-symbol { font-size: 11px; }
    .nav-pool-balance { font-size: 11px; }
    .logo-text { font-size: 13px; letter-spacing: .03em; }
    .logo-wrap img {
        width: 36px !important;
        height: 36px !important;
    }
}

@media (max-width: 420px) {
    .nav-pool-balance { display: none; }
    .nav-pool-symbol { font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════
 * TOOLTIP INFO — ícone com tooltip personalizado
 * ═══════════════════════════════════════════════════════════
 *
 * Mostra um ícone (assets/info.png) que, ao passar o mouse,
 * exibe um tooltip estilizado. Reutilizável em toda a UI.
 *
 * COMO USAR:
 *
 *   <span class="tooltip-info" data-tip="Texto do tooltip aqui.
 *   Pode ter quebra de linha com \A (não é literal, é CSS)
 *   ou usa elemento <br> dentro de spans separados.">
 *   </span>
 *
 *   <!-- Variante com texto inline (preferido pra textos longos) -->
 *   <span class="tooltip-info">
 *       <span class="tooltip-content">
 *           Linha 1 do tooltip<br>
 *           Linha 2 do tooltip
 *       </span>
 *   </span>
 *
 * VARIÁVEIS:
 *   --tooltip-icon-size  (16px default)
 *   --tooltip-bg         (#1a1d24 default)
 *   --tooltip-fg         (#e0e0e0 default)
 *   --tooltip-border     (rgba(255,255,255,0.12))
 * ═══════════════════════════════════════════════════════════ */
 
.tooltip-info {
    --tooltip-icon-size: 16px;
    --tooltip-bg:        #1a1d24;
    --tooltip-fg:        #e0e0e0;
    --tooltip-border:    #444439;
 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tooltip-icon-size);
    height: var(--tooltip-icon-size);
    background-image: url('/assets/info.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: help;
    vertical-align: middle;
    opacity: 0.55;
    transition: opacity 0.15s ease;
    position: relative;
    flex-shrink: 0;
}
 
.tooltip-info:hover {
    opacity: 1;
}
 
/* Tooltip content — fica oculto até hover */
.tooltip-info .tooltip-content {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
 
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
 
    min-width: 200px;
    max-width: 320px;
    width: max-content;
 
    padding: 10px 14px;
    border-radius: 4px;
    background: var(--tooltip-bg);
    border: 1px solid var(--tooltip-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
 
    color: var(--tooltip-fg);
    font-family: 'Inter', 'Share Tech Mono', monospace, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
    letter-spacing: 0.02em;
    text-transform: none;     /* sobrescreve heranças de UPPERCASE */
    white-space: normal;
 
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 9999;
}
 
/* Setinha apontando pra baixo (do tooltip → ícone) */
.tooltip-info .tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--tooltip-bg);
    /* sombra/borda lateral pra parecer continuidade do card */
    filter: drop-shadow(0 1px 0 var(--tooltip-border));
}
 
.tooltip-info:hover .tooltip-content,
.tooltip-info:focus-visible .tooltip-content,
.tooltip-info:focus-within .tooltip-content {
    visibility: visible;
    opacity: 1;
}
 
/* Quando o tooltip ficaria fora da tela à direita,
   o autor pode adicionar .tooltip-info--right ou --left manualmente */
.tooltip-info.tooltip-info--right .tooltip-content {
    left: auto;
    right: 0;
    transform: none;
}
.tooltip-info.tooltip-info--right .tooltip-content::after {
    left: auto;
    right: 12px;
    transform: none;
}
 
.tooltip-info.tooltip-info--left .tooltip-content {
    left: 0;
    right: auto;
    transform: none;
}
.tooltip-info.tooltip-info--left .tooltip-content::after {
    left: 12px;
    right: auto;
    transform: none;
}
 
/* Variante abaixo do ícone (em vez de acima) — quando o ícone tá no topo da UI */
.tooltip-info.tooltip-info--below .tooltip-content {
    bottom: auto;
    top: calc(100% + 8px);
}
.tooltip-info.tooltip-info--below .tooltip-content::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--tooltip-bg);
}
 
/* Tamanhos opcionais */
.tooltip-info.tooltip-info--sm { --tooltip-icon-size: 12px; }
.tooltip-info.tooltip-info--lg { --tooltip-icon-size: 20px; }
 
/* Acessibilidade — focusable via teclado */
.tooltip-info {
    background-color: #ffffff00;
}

/* ═══════════════════════════════════════════════════════════
 * APP-TOAST — Toasts padronizados (bottom-left)
 * ═══════════════════════════════════════════════════════════
 *
 * COMO USAR (via window.appToast helper):
 *   appToast('Mensagem');                // sucesso (default)
 *   appToast('Erro!', 'error');
 *   appToast('Aviso', 'warn');
 *
 * O JS abaixo cria o container e empilha toasts no canto inferior
 * esquerdo, animados da esquerda pra direita.
 * ═══════════════════════════════════════════════════════════ */
 
.app-toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column-reverse;  /* novo toast aparece embaixo, empurra anteriores pra cima */
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}
 
.app-toast {
    background: var(--bg-nav, #0e0e0e);
    border: 1px solid #444439;
    border-radius: 4px;
    padding: 40px 18px;
    color: #fff;
    font-size: 11px;
    letter-spacing: 0.12em;
    min-width: 200px;
    max-width: 360px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
 
    /* Animação: entra da esquerda */
    transform: translateX(-120%);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 0.18s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
 
.app-toast.show {
    transform: translateX(0);
    opacity: 1;
}
 
.app-toast.hide {
    transform: translateX(-120%);
    opacity: 0;
}
 
.app-toast-icon {
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}
 
.app-toast.success { border-color: #444439; }
.app-toast.success .app-toast-icon { color: #00ff88; }
 
.app-toast.error   { border-color: #444439; }
.app-toast.error   .app-toast-icon { color: #ff007f; }
 
.app-toast.warn    { border-color: #444439; }
.app-toast.warn    .app-toast-icon { color: #ffae00; }
 
.app-toast.info    { border-color: #444439; }
.app-toast.info    .app-toast-icon { color: #00d2ff; }
 
 
/* ═══════════════════════════════════════════════════════════
 * APP-MODAL — Modal de confirmação (centro da tela)
 * ═══════════════════════════════════════════════════════════
 *
 * COMO USAR (via window.appConfirm helper):
 *   const ok = await appConfirm({
 *       title: 'CONFIRM EXCHANGE',
 *       message: 'Exchange 0.1 SOL → 6 SC?<br>This is IRREVERSIBLE.',
 *       confirmText: 'CONFIRM',
 *       cancelText: 'CANCEL',
 *       confirmColor: 'green' | 'pink' | 'cyan'  // opcional
 *   });
 *   if (!ok) return;
 *
 * O JS abaixo cria/destroi o modal a cada chamada (sem poluir DOM).
 * ═══════════════════════════════════════════════════════════ */
 
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease;
    padding: 20px;
}
.app-modal-backdrop.show { opacity: 1; }
 
.app-modal {
    background: var(--bg-nav, #0e0e0e);
    border: 1px solid #444439;
    border-radius: 4px;
    padding: 24px 28px;
    min-width: 320px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    transform: scale(0.92);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.app-modal-backdrop.show .app-modal {
    transform: scale(1);
}
 
.app-modal-title {
    font-family: 'Pixel', sans-serif;
    font-size: 30px;
    letter-spacing: .05em;
    color: #fff;
    margin-bottom: 14px;
    text-transform: uppercase;
}
 
.app-modal-message {
    font-family: 'Inter', 'Share Tech Mono', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255,255,255,0.78);
    margin-bottom: 22px;
}
 
.app-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
 
.app-modal-btn {
    border: 1px solid #444439;
    background: transparent;
    color: rgba(255,255,255,0.7);
    padding: 10px 22px;
    border-radius: 4px;
    font-family: var(--head, 'Orbitron'), sans-serif;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 700;
}
.app-modal-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
 
/* Botão de confirmação — variantes por cor */
.app-modal-btn-confirm {
    background: var(--bored, #bfc500);
    color: #000;
    border-color: var(--border, #9d9b603d);
}
.app-modal-btn-confirm:hover { background: #fff; color: #000; }
 
.app-modal-btn-confirm.pink {
    background: var(#444439, #444439);
    border-color: var(#9d9b603d, #9d9b603d);
    color: #fff;
}
.app-modal-btn-confirm.pink:hover { background: #fff; color: var(--pink, #ff007f); }
 
/* Input do appPrompt */
.app-modal-input {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid #444439;
    border-radius: 4px;
    padding: 11px 14px;
    color: #fff;
    font-family: 'Inter', 'Share Tech Mono', sans-serif;
    font-size: 13px;
    margin-bottom: 18px;
    transition: border-color 0.15s ease;
    outline: none;
}
.app-modal-input:focus {
    border-color: var(--cyan, #00d2ff);
    background: rgba(0,0,0,0.6);
}
.app-modal-input::placeholder {
    color: rgba(255,255,255,0.3);
}