@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --cor-area: #1f8a3c;
    --cor-area-2: #146429;
    --cor-caixa: #4d2704;
    --cor-caixa-2: #2c1602;
    --cor-botao: #430a5e;
    --cor-botao-2: #6a1596;
    --cor-acento: #ffd166;
    --cor-fundo: #0b1c2c;
    --cor-texto: #fdf6ec;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Nunito', Arial, Helvetica, sans-serif;
    color: var(--cor-texto);
    background: var(--cor-fundo);
    min-height: 100vh;
}

h1, h2, .painel-moeda-total, .placar-titulo {
    font-family: 'Baloo 2', 'Nunito', sans-serif;
}

img {
    max-width: 100%;
}

/* =====================================================
   TELA DE SELEÇÃO
   ===================================================== */
.tela-selecao {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, #16324a 0%, #0b1c2c 65%);
}

.brilho {
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
}

.brilho-cao {
    background: #1f8a3c;
    top: -20vw;
    left: -20vw;
}

.brilho-gato {
    background: #7a3b8f;
    bottom: -20vw;
    right: -20vw;
}

.selecao-conteudo {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 720px;
}

.titulo-selecao {
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: 0.5px;
}

.titulo-selecao .vs {
    color: var(--cor-acento);
    font-size: 0.6em;
    vertical-align: middle;
    margin: 0 8px;
}

.subtitulo-selecao {
    font-size: 1.15rem;
    color: #cfe3f0;
    margin: 0 0 40px;
}

.cartas-selecao {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

.carta-pet {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 230px;
    padding: 30px 20px 24px;
    border: none;
    border-radius: 20px;
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

.carta-pet:hover {
    transform: translateY(-6px) scale(1.02);
}

.carta-pet:active {
    transform: translateY(-2px) scale(0.99);
}

.carta-pet-icone {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.carta-pet-icone img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.carta-pet .emoji-hero {
    font-size: 72px;
    line-height: 1;
}

.carta-pet-nome {
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
}

.carta-pet-legenda {
    font-size: 0.85rem;
    opacity: 0.85;
}

.carta-cachorro {
    background: linear-gradient(160deg, #2fae52, #146429);
}

.carta-gato {
    background: linear-gradient(160deg, #9c5cb8, #5a2470);
}

.dica-selecao {
    margin-top: 34px;
    font-size: 0.85rem;
    color: #9db3c2;
}

/* =====================================================
   TELA DE JOGO
   ===================================================== */
.tela-jogo {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--cor-area) 0%, var(--cor-area-2) 100%);
}

.topo-jogo {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(0,0,0,0.28);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.topo-jogo-linha {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.btt_trocar {
    flex: 0 0 auto;
    background-color: var(--cor-botao);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btt_trocar:hover {
    background-color: var(--cor-botao-2);
}

.btt_trocar:active {
    transform: scale(0.96);
}

.placar-globo {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.image_globo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.placar-globo-info {
    flex: 1 1 auto;
    min-width: 0;
}

.placar-titulo {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.barra-preferencia {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(0,0,0,0.35);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.barra-preferencia-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cor-acento), #fff2cc);
    transition: width 0.6s ease;
}

.placar-detalhe {
    display: block;
    font-size: 0.78rem;
    color: #e7f0e9;
    margin-top: 4px;
    opacity: 0.9;
}

/* ---------- Corpo ---------- */
.corpo-jogo {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.area-clique {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.18);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 36px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.botao-moeda {
    background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.35), rgba(255,255,255,0) 60%), rgba(255,255,255,0.08);
    border: none;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.08s ease;
    box-shadow: 0 8px 0 rgba(0,0,0,0.35), 0 10px 20px rgba(0,0,0,0.35);
}

.botao-moeda:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.35), 0 4px 10px rgba(0,0,0,0.3);
}

.image_osso {
    width: 90px;
    pointer-events: none;
    user-select: none;
}

.emoji_moeda {
    font-size: 80px;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.painel-moeda {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 160px;
}

.painel-moeda-label {
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 0.85;
}

.painel-moeda-total {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.15;
}

.painel-moeda-taxa {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b9f6c8;
    min-height: 1.2em;
}

.titulo-secao {
    font-size: 1.3rem;
    margin: 0 0 16px;
    padding-left: 2px;
}

/* ---------- Grade de upgrades ---------- */
.grade-upgrades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.carta-upgrade {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--cor-caixa);
    background-image: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(0,0,0,0.12));
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: cartaEntrar 0.35s ease;
}

@keyframes cartaEntrar {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.carta-upgrade-topo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.carta-upgrade-icone {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    overflow: hidden;
}

.carta-upgrade-icone img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.carta-upgrade-titulo {
    flex: 1 1 auto;
    min-width: 0;
}

.carta-upgrade-nome {
    display: block;
    font-weight: 800;
    font-size: 1rem;
    font-family: 'Baloo 2', sans-serif;
}

.carta-upgrade-contador {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 1px 10px;
    margin-top: 3px;
}

.carta-upgrade-desc {
    flex: 1 1 auto;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #f1e6d8;
    opacity: 0.92;
    margin: 0 0 12px;
}

.carta-upgrade-desc br {
    content: "";
}

.carta-upgrade-rodape {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.carta-upgrade-custo {
    font-size: 0.75rem;
    opacity: 0.8;
}

.btt_cao {
    background-color: var(--cor-botao);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btt_cao:hover {
    background-color: var(--cor-botao-2);
}

.btt_cao:active {
    transform: scale(0.94);
}

.btt_cao:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ---------- Cartas bloqueadas ---------- */
.carta-upgrade.bloqueada {
    filter: grayscale(0.85);
}

.carta-upgrade.bloqueada .carta-upgrade-rodape,
.carta-upgrade.bloqueada .carta-upgrade-desc {
    visibility: hidden;
}

.carta-upgrade-cadeado {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 12px;
}

.carta-upgrade.bloqueada .carta-upgrade-cadeado {
    display: flex;
}

.carta-upgrade-cadeado-icone {
    font-size: 26px;
}

.carta-upgrade-cadeado-texto {
    font-size: 0.8rem;
    font-weight: 700;
}

/* =====================================================
   TOASTS
   ===================================================== */
.toast-area {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    max-width: calc(100vw - 40px);
}

.toast-msg {
    background-color: #1a1a1a;
    color: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    animation: toastIn 0.2s ease, toastOut 0.4s ease 3.6s forwards;
    max-width: 300px;
    font-size: 0.85rem;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* =====================================================
   RESPONSIVO
   ===================================================== */
@media (max-width: 560px) {
    .topo-jogo-linha {
        flex-wrap: wrap;
    }

    .btt_trocar {
        order: 2;
    }

    .placar-globo {
        order: 1;
        flex: 1 1 100%;
    }

    .area-clique {
        flex-direction: column;
        padding: 22px;
    }

    .painel-moeda {
        align-items: center;
        text-align: center;
    }
}
