/* ================================================================
   Game Detail Modal — Estilos Unificados (Biblioteca + Details)
   ================================================================ */

/* --- Overlay --- */
.game-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1500;  /* acima dos botões mobile fixos (bottom-bar ~1050) */
    background: rgba(0, 0, 0, 0.78);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.game-modal-overlay.active {
    display: flex;
}

/* --- Botão X de Fechar no Topo --- */
.gm-btn-top-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 0.85rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.gm-btn-top-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.game-modal-box { position: relative; }
.game-modal-box {
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    border: 1px solid rgba(16, 124, 16, 0.35);
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
    overflow: hidden;
    animation: modalFadeIn 0.22s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* --- Parte Scrollável --- */
.game-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 1.25rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #107c10 #1a1a2e;
    /* Fallback webkit */
    overflow: auto;
}
.game-modal-body::-webkit-scrollbar { width: 6px; }
.game-modal-body::-webkit-scrollbar-track { background: #1a1a2e; }
.game-modal-body::-webkit-scrollbar-thumb { background: #107c10; border-radius: 4px; }

/* --- Header (imagem + nome + dev) --- */
.game-modal-header-section {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}
.game-modal-cover {
    width: 110px;
    min-width: 110px;
    height: 145px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid rgba(16,124,16,0.4);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.game-modal-info-block {
    flex: 1;
    min-width: 0;
}
.game-modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.game-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0;
    line-height: 1.3;
}

.gm-user-actions-row {
    display: flex;
    gap: 10px;
    margin-left: auto;
    padding-right: 36px;
}

.gm-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.gm-action-btn:hover {
    background: rgba(16, 124, 16, 0.15);
    border-color: rgba(16, 124, 16, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gm-action-btn.active#gmBtnWishlist {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
    border-color: rgba(255, 71, 87, 0.3);
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.2);
}

.gm-action-btn.active#gmBtnMyGames {
    color: #107c10;
    background: rgba(16, 124, 16, 0.1);
    border-color: rgba(16, 124, 16, 0.3);
    box-shadow: 0 0 10px rgba(16, 124, 16, 0.2);
}

.gm-type-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: none;
}
.game-modal-dev {
    font-size: 0.78rem;
    color: #8a8a8a;
    margin-bottom: 0.6rem;
}
.game-modal-descricao {
    font-size: 0.83rem;
    color: #b0b0b0;
    line-height: 1.5;
    position: relative;
    max-height: 5.6rem; /* Aproximadamente 4 linhas */
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.game-modal-descricao.expanded {
    max-height: 1000px; /* Expande totalmente */
}
.gm-read-more-btn {
    display: none;
    background: none;
    border: none;
    color: #107c10;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 0;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 4px;
}

/* --- Seção genérica --- */
.gm-section {
    margin-bottom: 1.25rem;
}
.gm-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #107c10;
    margin-bottom: 0.5rem;
}

/* --- Promoção Tag --- */
.gm-promo-badge-large {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(16, 124, 16, 0.3) 0%, rgba(10, 80, 10, 0.4) 100%);
    border: 1px solid rgba(16, 124, 16, 0.5);
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

.gm-promo-badge-large::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top right, rgba(111, 207, 151, 0.1), transparent);
    pointer-events: none;
}

.gm-promo-tag-text {
    color: #6fcf97;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.gm-promo-validity {
    color: #aaa;
    font-size: 0.78rem;
    font-weight: 500;
}

.gm-promo-validity strong {
    color: #ffd460;
}

/* --- Tags --- */
.gm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.gm-tag {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: #e0e0e0;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.gm-tag.green  { background: rgba(16,124,16,0.2);   border-color: rgba(16,124,16,0.4);  color: #6fcf97; }
.gm-tag.blue   { background: rgba(0,112,255,0.18);  border-color: rgba(0,112,255,0.4);  color: #82b8ff; }
.gm-tag.red    { background: rgba(255,71,71,0.18);  border-color: rgba(255,71,71,0.4);  color: #ff8e8e; }
.gm-tag.gold   { background: rgba(153,116,30,0.25); border-color: rgba(153,116,30,0.5); color: #ffd460; }

/* --- Tabela de Preços --- */
.gm-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.gm-price-table thead th {
    background: rgba(255,255,255,0.05);
    color: #8a8a8a;
    font-weight: 600;
    padding: 6px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}
.gm-price-table thead th:first-child { text-align: left; }
.gm-price-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.03); }
.gm-price-table tbody td {
    padding: 7px 10px;
    color: #ddd;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.gm-price-table tbody td:first-child {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.gm-flag-img {
    vertical-align: middle;
    border-radius: 2px;
    margin-right: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.gm-flag { font-size: 1.2rem; line-height: 1; }
.gm-country-name {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 600;
}
.gm-price-strike { text-decoration: line-through; color: #666; }
.gm-price-active { color: #6fcf97; font-weight: 700; }
.gm-price-historic { color: #ffd460; font-weight: 700; }
.gm-price-date { font-size: 0.72rem; color: #777; }

.gm-price-converted {
    color: #6fcf97;
    font-weight: 700;
}

.gm-exchange-note {
    font-size: 0.72rem;
    color: #8a8a8a;
    margin-top: 8px;
    padding: 2px 4px;
    display: none;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 8px;
}

.gm-exchange-note strong {
    color: #ccc;
}

.gm-td-converted {
    background: rgba(111, 207, 151, 0.03);
}

/* --- Assinaturas --- */
.gm-sub-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.gm-sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.gm-sub-badge.gp  { background: rgba(16,124,16,0.25); border: 1px solid #107c10; color: #6fcf97; }
.gm-sub-badge.ea  { background: rgba(255,71,71,0.2);  border: 1px solid #ff4747; color: #ff9999; }
.gm-sub-badge.ubi { background: rgba(0,80,160,0.25);  border: 1px solid #0050a0; color: #80b0ff; }
.gm-exclusive-note {
    font-size: 0.78rem;
    color: #ffd460;
    background: rgba(153,116,30,0.15);
    border: 1px solid rgba(153,116,30,0.3);
    border-radius: 8px;
    padding: 5px 10px;
    margin-top: 0.4rem;
}

/* --- Gráfico --- */
.gm-chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 8px;
    flex-wrap: wrap;
}

.gm-chart-period-group {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
}

.gm-period-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.gm-period-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.gm-period-btn.active { background: #107c10; color: #fff; }

.gm-chart-btn-group {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
}
.gm-chart-btn {
    background: transparent;
    border: none;
    color: #8a8a8a;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.gm-chart-btn:hover { background: rgba(255,255,255,0.07); color: #fff; }
.gm-chart-btn.active { background: #107c10; color: #fff; }
.gm-chart-wrapper {
    position: relative;
    height: 180px;
}
.gm-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 130px;
    color: #555;
    font-size: 0.82rem;
    flex-direction: column;
    gap: 0.5rem;
}

/* --- Rodapé Fixo --- */
.game-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(0deg, #0f1a2e 0%, transparent 100%);
    position: sticky;
    bottom: 0;
}
.gm-btn-confirm {
    flex: 1;
    background: #107c10;
    color: #fff !important;          /* força branco — evita link azul */
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none !important; /* remove sublinhado */
}
.gm-btn-confirm:hover {
    background: #0a5c0a;
    transform: translateY(-1px);
    color: #fff !important;          /* garante branco no hover */
    text-decoration: none !important;
}
.gm-btn-close {
    background: rgba(255,255,255,0.07);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}
.gm-btn-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* --- Divider --- */
.gm-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 0 0 1.1rem 0;
}

/* --- Responsivo --- */
@media (max-width: 576px) {
    /* Empurra o modal para cima da bottom bar (~65px de altura + folga) */
    .game-modal-overlay {
        padding-bottom: 70px; /* espaço para bottom bar */
        padding-top: 70px;    /* espaço para barra de pesquisa */
        align-items: center;  /* centraliza verticalmente */
        padding-left: 0;
        padding-right: 0;
    }
    .game-modal-box {
        max-height: calc(100vh - 140px);
        border-radius: 12px;
        width: 94%;           /* leve margem lateral no mobile */
        margin: 0 auto;
    }
    .game-modal-cover { width: 80px; min-width: 80px; height: 106px; }
    .game-modal-title { font-size: 0.95rem; }
    .gm-price-table { font-size: 0.75rem; }
    .gm-promo-tag-text { font-size: 0.85rem; } /* Fonte menor no mobile */
}

/* ── Seletor de Idioma Mobile — remove azul/sublinhado ao clicar ── */
.mobile-lang-switcher,
.mobile-lang-switcher:hover,
.mobile-lang-switcher:focus,
.mobile-lang-switcher:active,
.mobile-lang-switcher:visited {
    color: inherit !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
