/* ============================================================
   adivinha_copa.css — Adivinha da Copa
   ============================================================ */

#ac-app {
    width: 100%;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: acFadeIn 0.4s ease;
}

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

.ac-tela {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ═══════════════════════════════════════════════════
   TELA INÍCIO
   ═══════════════════════════════════════════════════ */
#ac-tela-inicio {
    max-width: 780px;
}

.ac-inicio-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    background: white;
    border-radius: 24px;
    padding: 32px 28px;
    border: 3px solid var(--azul-copa);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    width: 100%;
}

.ac-inicio-esq {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ac-nuvito-inicio {
    height: 200px;
    width: auto;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.2));
    animation: acBounce 2.5s ease-in-out infinite;
}

@keyframes acBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-12px); }
}

.ac-inicio-dir {
    flex: 1;
    text-align: left;
}

.ac-logo-emoji {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 6px;
}

.ac-inicio-dir h2 {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--azul-copa);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.ac-inicio-dir p {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 16px;
}

.ac-regras {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f0f4ff;
    border: 2px solid rgba(0,39,118,0.12);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.ac-regra-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--azul-copa);
}
.ac-regra-item span:first-child { font-size: 1.2rem; flex-shrink: 0; }

.ac-btn-comecar {
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 900;
    color: white;
    background: linear-gradient(135deg, var(--verde-copa), #00c44e);
    border: none;
    border-bottom: 5px solid #006b28;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.15s ease;
    box-shadow: 0 6px 20px rgba(0,156,59,0.4);
}
.ac-btn-comecar:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,156,59,0.5); }
.ac-btn-comecar:active { transform: translateY(3px); border-bottom-width: 2px; }

/* ═══════════════════════════════════════════════════
   HUD E PLACAR
   ═══════════════════════════════════════════════════ */
.ac-hud {
    /* Fundo Animado Premium */
    background: linear-gradient(135deg, #0f172a, #1e3a8a, #312e81, #0f172a);
    background-size: 300% 300%;
    animation: acHudFlow 8s ease infinite, acHudFloat 4s ease-in-out infinite;
    
    border-radius: 20px;
    padding: 14px 28px;
    display: flex;
    justify-content: center;
    gap: 35px;
    align-items: center;
    color: white;
    
    /* Efeito Glassmorphism e Brilho Interno */
    box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 2px 5px rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Posição Fixa no Topo e Centralizada (na altura do Voltar) */
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

@keyframes acHudFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes acHudFloat {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -6px); }
}

.ac-hud.on-fire {
    background: linear-gradient(135deg, #991b1b, #ef4444, #f59e0b, #991b1b);
    background-size: 300% 300%;
    border-color: #fde047;
    box-shadow: 0 0 30px rgba(249,115,22,0.8), inset 0 2px 10px rgba(255,255,255,0.4);
    animation: acHudFlow 4s ease infinite, acFirePulse 1.5s infinite, acHudFloat 3s ease-in-out infinite;
}

@keyframes acFirePulse {
    0%, 100% { transform: translate(-50%, 0) scale(1); box-shadow: 0 0 25px rgba(249,115,22,0.6); }
    50% { transform: translate(-50%, -8px) scale(1.03); box-shadow: 0 0 45px rgba(239,68,68,0.9); }
}

.ac-hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
}

.ac-hud-divisor {
    font-size: 2.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.25);
    user-select: none;
}

.ac-hud-label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.9;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.ac-hud-valor {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0px 4px 10px rgba(0,0,0,0.5);
    font-family: 'Inter', sans-serif;
}

.ac-hud-combo {
    background: linear-gradient(to bottom, #fef08a, #eab308);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 3px 5px rgba(0,0,0,0.6));
    font-style: italic;
    transform: scale(1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ac-hud.on-fire .ac-hud-combo {
    background: linear-gradient(to bottom, #ffffff, #fde047);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(253,224,71,0.8));
}

/* ═══════════════════════════════════════════════════
   TELA JOGO
   ═══════════════════════════════════════════════════ */
#ac-tela-jogo {
    max-width: 850px;
    width: 100%;
}

.ac-jogo-header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 60px;
}

.ac-jogo-titulo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--azul-copa);
    text-transform: uppercase;
    text-shadow: 1px 1px 0px white, -1px -1px 0px white, 1px -1px 0px white, -1px 1px 0px white;
}

.ac-jogo-sub {
    font-size: 0.95rem;
    color: #64748b;
    margin-top: 5px;
}

.ac-jogo-contador {
    font-size: 1.1rem;
    font-weight: 800;
    color: #3b82f6;
    margin-top: 15px;
    background: #eff6ff;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 50px;
    border: 2px solid #bfdbfe;
    transition: color 0.3s ease;
}

/* Área de Inputs */
.ac-inputs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.7);
    border-radius: 20px;
    border: 2px dashed #cbd5e1;
}

.ac-input-wrapper {
    position: relative;
    width: calc(33.333% - 10px);
    min-width: 220px;
    animation: acPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes acPopIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.ac-input-box {
    width: 100%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-bottom: 5px solid #94a3b8;
    border-radius: 12px;
    padding: 14px 35px 14px 16px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    outline: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.ac-input-box:focus {
    border-color: var(--azul-copa);
    border-bottom-color: #1d4ed8;
    box-shadow: 0 8px 20px rgba(0,39,118,0.15);
    transform: translateY(-2px);
}

.ac-input-box::placeholder {
    color: #94a3b8;
    font-weight: 600;
    text-transform: none;
}

.ac-input-box:disabled {
    background: #f8fafc;
    color: #475569;
    opacity: 1;
}

/* Estados do Input (Certo/Errado/Carregando/Pendente) */
.ac-input-wrapper.certo .ac-input-box {
    border-color: #fbbf24;
    border-bottom-color: #d97706;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #92400e;
    box-shadow: 0 6px 15px rgba(245,158,11,0.2);
}

.ac-input-wrapper.pendente .ac-input-box {
    border-color: #3b82f6;
    border-bottom-color: #1d4ed8;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e3a8a;
}

.ac-input-wrapper.errado .ac-input-box {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.ac-input-wrapper.loading .ac-input-box {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #b45309;
}

.ac-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.ac-input-wrapper.certo .ac-input-icon::after { content: '✅'; }
.ac-input-wrapper.errado .ac-input-icon::after { content: '❌'; }
.ac-input-wrapper.loading .ac-input-icon::after { content: '⏳'; animation: acSpin 2s linear infinite; display: inline-block; }

.ac-btn-lixeira {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #fee2e2;
    border: 2px solid #fca5a5;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    z-index: 5;
    transition: all 0.2s;
}
.ac-btn-lixeira:hover {
    background: #fecaca;
    transform: translateY(-50%) scale(1.1);
}
/* Show trash button when input is disabled (confirmed) */
.ac-input-box:disabled ~ .ac-btn-lixeira {
    display: flex;
}

.ac-nuvito-pulo {
    animation: acJump 0.5s ease !important;
}
@keyframes acJump {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.1); }
}
.ac-input-wrapper.loading .ac-input-icon::after { content: '⏳'; animation: acSpin 2s linear infinite; display: inline-block; }

@keyframes acSpin { 100% { transform: rotate(360deg); } }

/* Animações de Feedback */
@keyframes acShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}
.ac-input-wrapper.errado { animation: acShake 0.4s ease; }

@keyframes acBounceSuccess {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}
.ac-input-wrapper.certo { animation: acBounceSuccess 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* Partículas e Textos Flutuantes */
.ac-pontos-flutuante {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    font-weight: 900;
    color: #10b981;
    text-shadow: 2px 2px 0px white, -1px -1px 0px white;
    pointer-events: none;
    z-index: 10;
    animation: acFloatUp 1.2s ease-out forwards;
}

@keyframes acFloatUp {
    0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -15px) scale(1.2); }
    80% { opacity: 1; transform: translate(-50%, -30px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -40px) scale(0.8); }
}

.ac-estrela {
    position: absolute;
    font-size: 1.2rem;
    color: #f59e0b;
    pointer-events: none;
    z-index: 9;
    animation: acStarBurst 1s ease-out forwards;
}

@keyframes acStarBurst {
    0% { opacity: 1; transform: scale(0.5) rotate(0deg); }
    100% { opacity: 0; transform: scale(1.5) rotate(180deg) translate(var(--tx), var(--ty)); }
}


/* Botões de Ação na Tela de Jogo */
.ac-controles {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ac-btn-acao {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 800;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ac-btn-acao:active { transform: translateY(2px); border-bottom-width: 2px !important; }
.ac-btn-acao:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.ac-btn-add {
    background: #e2e8f0;
    color: #334155;
    border-bottom: 4px solid #cbd5e1;
}
.ac-btn-add:hover:not(:disabled) { background: #cbd5e1; }

.ac-btn-verificar {
    background: linear-gradient(135deg, var(--verde-copa), #00d44e);
    color: white;
    border-bottom: 4px solid #006b28;
    box-shadow: 0 4px 15px rgba(0,156,59,0.3);
}
.ac-btn-verificar:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,156,59,0.4); }

/* ═══════════════════════════════════════════════════
   RESULTADO TELA
   ═══════════════════════════════════════════════════ */
#ac-tela-resultado {
    background: white;
    border-radius: 24px;
    padding: 30px 40px;
    border: 3px solid var(--azul-copa);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    text-align: center;
    max-width: 600px;
}

.ac-img-resultado {
    width: 160px;
    margin-bottom: 15px;
    animation: acTada 2.5s infinite ease-in-out;
}

@keyframes acTada {
    0%, 100% { transform: scale(1) rotate(0deg); }
    10%, 20% { transform: scale(0.95) rotate(-4deg); }
    30%, 50%, 70%, 90% { transform: scale(1.05) rotate(4deg); }
    40%, 60%, 80% { transform: scale(1.05) rotate(-4deg); }
}

.ac-res-titulo {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--azul-copa);
    margin-top: 10px;
    margin-bottom: 10px;
}

.ac-res-sub {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 24px;
}

.ac-res-destaque-pontos {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 3px solid #fde68a;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    display: inline-block;
    min-width: 250px;
    box-shadow: 0 4px 15px rgba(245,158,11,0.15);
}

.ac-res-pontos-valor {
    font-size: 4rem;
    font-weight: 900;
    color: #92400e;
    line-height: 1;
    margin-bottom: 5px;
    text-shadow: 2px 2px 0 #fde68a;
}

.ac-res-pontos-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: #b45309;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ac-res-caixas {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.ac-res-caixa {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ac-res-caixa span {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 4px;
}

.ac-res-caixa small {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .ac-inicio-inner { flex-direction: column; text-align: center; }
    .ac-input-wrapper { width: calc(50% - 10px); }
    .ac-res-caixas { flex-direction: column; }
    
    .ac-hud {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin-bottom: 20px;
        width: 100%;
        gap: 15px;
        animation: acHudFlow 8s ease infinite; /* Remove float on mobile to prevent layout jitter */
    }
    
    .ac-hud.on-fire {
        animation: acHudFlow 4s ease infinite;
    }
    
    .ac-jogo-header {
        margin-top: 0;
    }
}
@media (max-width: 480px) {
    .ac-input-wrapper { width: 100%; }
}

/* ── CONFETES ─────────────────────────────────────── */
.ac-confete {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    background-color: #f1c40f;
    z-index: 99999;
    animation: acCairConfete linear forwards;
    pointer-events: none;
    border-radius: 50%;
}

@keyframes acCairConfete {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
