/* ============================================================
   teclado_copa.css v2 — Teclado Copa — Copa do Mundo 2026
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;700;900&display=swap');

/* ── WRAPPER PRINCIPAL ─────────────────────────────── */
#tcopa-app {
    width: 100%;
    font-family: 'Fredoka', 'Inter', sans-serif;
    position: relative;
}

/* ── TELA INÍCIO / RESULTADO ───────────────────────── */
#tcopa-inicio,
#tcopa-resultado {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0 20px;
}

.tcopa-menu-caixa {
    background: white;
    border-radius: 24px;
    border: 5px solid #ffdf00;
    padding: 28px 24px 22px;
    text-align: center;
    width: min(92%, 420px);
    box-shadow: 0 10px 36px rgba(0,0,0,0.25);
}

.tcopa-logo-emoji {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 8px;
    animation: tcopaBounce 1.8s ease-in-out infinite;
}
@keyframes tcopaBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50%       { transform: translateY(-10px) rotate(5deg); }
}

.tcopa-menu-caixa h2 {
    font-size: 1.7rem;
    font-weight: 900;
    color: #002776;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.tcopa-menu-caixa p {
    font-size: 0.88rem;
    color: #4b5563;
    margin-bottom: 18px;
    line-height: 1.5;
}

/* ── BOTÕES MODO ────────────────────────────────────── */
.tcopa-btn-modo {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 800;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    margin-bottom: 10px;
    transition: transform 0.12s ease;
    line-height: 1.3;
}
.tcopa-btn-modo:active { transform: scale(0.96) translateY(2px); }
.tcopa-btn-modo small { font-size: 0.75rem; font-weight: 600; opacity: 0.85; }

.tcopa-btn-bandeiras {
    background: linear-gradient(135deg, #002776, #0036a8);
    color: white;
    box-shadow: 0 5px 0 #001344;
}
.tcopa-btn-bandeiras:hover { transform: translateY(-2px); }

.tcopa-btn-copa {
    background: linear-gradient(135deg, #009c3b, #00c44e);
    color: white;
    box-shadow: 0 5px 0 #005a22;
}
.tcopa-btn-copa:hover { transform: translateY(-2px); }

.tcopa-btn-link {
    display: none; /* Removido a pedido do usuário */
}
.tcopa-btn-link:hover { background: #f1f5f9; color: #1e293b; }

/* ── HUD ────────────────────────────────────────────── */
.tcopa-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 39, 118, 0.9);
    border-radius: 14px 14px 0 0;
    padding: 8px 14px;
    gap: 12px;
    position: relative;
    flex-wrap: wrap;
}

.tcopa-hud-relogio {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffdf00;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.tcopa-hud-relogio.acabando {
    color: #ef4444;
    animation: tcopaPiscaRelogio 1s infinite alternate;
}
@keyframes tcopaPiscaRelogio {
    from { opacity: 1; transform: scale(1.05); }
    to { opacity: 0.5; transform: scale(1); }
}

/* Barra de Progresso do Tempo */
.tcopa-prog-wrap {
    flex: 1;
    min-width: 100px;
    height: 14px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255,255,255,0.1);
}
.tcopa-prog-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #2ecc71, #00b894);
    transition: width 0.1s linear, background-color 0.3s;
    border-radius: 10px;
}
.tcopa-prog-fill.acabando {
    background: linear-gradient(90deg, #ef4444, #ff7675);
}

.tcopa-hud-badges {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.tcopa-badge {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #002776;
    white-space: nowrap;
}

/* Badge de Combo */
.tcopa-combo {
    background: linear-gradient(90deg, #ff9a9e, #fecfef);
    color: #c0392b;
    border: 2px solid #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
    display: none;
    animation: tcopaPulseCombo 0.6s infinite alternate;
}
@keyframes tcopaPulseCombo {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* ── CAMPO ──────────────────────────────────────────── */
#tcopa-campo {
    position: relative;
    width: 100%;
    height: 420px;
    background: linear-gradient(180deg, #006632 0%, #009c3b 50%, #007a2e 100%);
    background-image: url('../img/tcopa_campo_bg.png');
    background-size: cover;
    background-position: center;
    overflow: hidden;
    border-left: 3px solid #ffdf00;
    border-right: 3px solid #ffdf00;
    transition: box-shadow 0.2s ease;
}

/* Efeito Perigo (Tempo Acabando) */
#tcopa-campo.tcopa-perigo {
    animation: tcopaPulsoPerigo 0.8s infinite alternate;
}
@keyframes tcopaPulsoPerigo {
    from { box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.2); }
    to { box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.8); }
}

/* Linhas decorativas do campo */
#tcopa-campo::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0,0,0,0.08) 0px,
            rgba(0,0,0,0.08) 40px,
            transparent 40px,
            transparent 80px
        );
    pointer-events: none;
}

/* Linha do chão */
#tcopa-chao {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    height: 5px;
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239,68,68,0.7);
}

/* ── PALAVRAS CAINDO ───────────────────────────────── */
.tcopa-palavra {
    position: absolute;
    top: 0;
    background: white;
    border: 3px solid #002776;
    border-radius: 16px;
    padding: 7px 14px;
    font-size: 1.05rem;
    font-weight: 800;
    font-family: 'Fredoka', sans-serif;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 0 rgba(0,0,0,0.3);
    will-change: transform;
    pointer-events: none;
    user-select: none;
}

/* POWER-UPS STYLES */
.tcopa-power-freeze { border-color: #0984e3; box-shadow: 0 4px 0 #0984e3; color: #0984e3; }
.tcopa-power-slow { border-color: #f1c40f; box-shadow: 0 4px 0 #f1c40f; color: #d35400; }
.tcopa-power-time { border-color: #00b894; box-shadow: 0 4px 0 #00b894; color: #00b894; }
.tcopa-power-lightning { border-color: #9b59b6; box-shadow: 0 4px 0 #9b59b6; color: #8e44ad; }

/* Palavra Dourada */
.tcopa-golden {
    background: linear-gradient(135deg, #ffd700, #f39c12) !important;
    color: #fff !important;
    border-color: #e67e22 !important;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.8), inset 0 0 5px rgba(255,255,255,0.8) !important;
    animation: tcopaGoldenBrilho 1.5s infinite alternate !important;
    text-shadow: 0 2px 2px rgba(0,0,0,0.3);
}
@keyframes tcopaGoldenBrilho {
    from { box-shadow: 0 0 10px rgba(243, 156, 18, 0.5); }
    to { box-shadow: 0 0 25px rgba(255, 215, 0, 1); }
}

/* Destaque Letra a Letra */
.tcopa-txt-hl {
    color: #22c55e !important;
    text-shadow: 0 0 5px rgba(34, 197, 94, 0.8), 0 0 1px #000;
    font-weight: 900;
}

/* EFEITO CONGELAMENTO DA TELA */
#tcopa-efeito-gelo {
    position: absolute;
    inset: 0;
    background: rgba(0, 168, 255, 0.25);
    box-shadow: inset 0 0 60px rgba(255,255,255,0.6);
    pointer-events: none;
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#tcopa-efeito-gelo.ativo {
    opacity: 1;
}

.tcopa-flag {
    height: 20px;
    width: auto;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.12);
    object-fit: contain;
    flex-shrink: 0;
}

.tcopa-emoji {
    font-size: 1rem;
    line-height: 1;
}

/* ── INPUT ──────────────────────────────────────────── */
.tcopa-input-area {
    background: rgba(0,0,0,0.5);
    border-radius: 0 0 14px 14px;
    border: 3px solid #ffdf00;
    border-top: none;
    padding: 10px 12px;
}

#tcopa-input {
    width: 100%;
    padding: 11px 18px;
    font-size: 1.35rem;
    font-weight: 800;
    font-family: 'Fredoka', sans-serif;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    background: white;
    color: #002776;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    letter-spacing: 2px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    transition: border-color 0.15s;
}
#tcopa-input:focus { border-color: #009c3b; }

/* ── COUNTDOWN ──────────────────────────────────────── */
.tcopa-countdown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    font-weight: 900;
    font-family: 'Fredoka', sans-serif;
    color: white;
    text-shadow: 0 6px 24px rgba(0,0,0,0.6);
    z-index: 50;
    animation: tcopaCountAnim 0.7s ease;
    pointer-events: none;
}
@keyframes tcopaCountAnim {
    from { transform: scale(1.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ── PARTÍCULAS ─────────────────────────────────────── */
.tcopa-particula {
    position: absolute;
    width: 10px; height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 30;
    animation: tcopaParticula 0.65s ease-out forwards;
}
@keyframes tcopaParticula {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* ── SHAKE ───────────────────────────────────────────── */
.tcopa-shake { animation: tcopaShake 0.38s ease both; }
@keyframes tcopaShake {
    0%, 100% { transform: translateX(0); }
    20%  { transform: translateX(-9px) rotate(-1deg); }
    40%  { transform: translateX(9px) rotate(1deg); }
    60%  { transform: translateX(-5px); }
    80%  { transform: translateX(5px); }
}

/* ── RESULTADO ───────────────────────────────────────── */
.tcopa-res-pontos {
    font-size: 3rem;
    font-weight: 900;
    color: #ffdf00;
    text-shadow: 2px 2px 0 #002776;
    line-height: 1;
    margin: 10px 0 2px;
}

.tcopa-res-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 16px;
}

.tcopa-res-stats {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 18px;
}

.tcopa-res-stat {
    background: #f0f4ff;
    border: 2px solid rgba(0,39,118,0.15);
    border-radius: 12px;
    padding: 8px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tcopa-res-stat span { font-size: 1.8rem; font-weight: 900; color: #002776; line-height: 1; }
.tcopa-res-stat small { font-size: 0.7rem; font-weight: 700; color: #64748b; text-transform: uppercase; }

/* ── LISTA DE PALAVRAS DIGITADAS ────────────────────── */
.tcopa-res-lista-box {
    margin: 15px 0 20px;
    max-height: 140px;
    overflow-y: auto;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 12px;
}
.tcopa-res-lista-box h3 {
    font-size: 0.9rem;
    color: #4b5563;
    margin: 0 0 10px;
    text-align: center;
    text-transform: uppercase;
    font-weight: 800;
}
.tcopa-res-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.tcopa-res-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 2px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.tcopa-res-item.golden {
    background: #fffbe6;
    border-color: #f59e0b;
    color: #b45309;
}
.tcopa-flag-mini {
    height: 14px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.1);
}
.tcopa-emoji-mini {
    font-size: 0.95rem;
    line-height: 1;
}

/* Custom Scrollbar for list */
.tcopa-res-lista-box::-webkit-scrollbar { width: 6px; }
.tcopa-res-lista-box::-webkit-scrollbar-track { background: transparent; }
.tcopa-res-lista-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* ── ANIMAÇÕES ESPECIAIS (FOGO & BOLA) ──────────────── */
.tcopa-bola-chute {
    position: absolute;
    font-size: 1.8rem;
    z-index: 60;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    line-height: 1;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}


/* ── ANIMAÇÕES DA TELA DE RESULTADO ─────────────────── */
.tcopa-confete {
    position: fixed;
    top: -10px;
    width: 11px; height: 11px;
    border-radius: 3px;
    animation: tcopaConfeteAnim linear forwards;
    pointer-events: none;
    z-index: 9999;
}

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

@keyframes tcopaBalanco {
    0%, 100% { transform: rotate(-8deg) translateY(0); }
    50% { transform: rotate(8deg) translateY(-8px); }
}

/* ── RESPONSIVO ─────────────────────────────────────── */
@media (max-height: 800px) and (min-width: 501px) {
    #tcopa-campo { height: 320px; }
    .tcopa-menu-caixa { padding: 20px 20px 16px; margin-top: -15px; }
    .tcopa-logo-emoji { font-size: 2.2rem; margin-bottom: 4px; }
    .tcopa-menu-caixa h2 { font-size: 1.4rem; margin-bottom: 4px; }
    .tcopa-menu-caixa p { font-size: 0.8rem; margin-bottom: 12px; }
    #tcopa-input { font-size: 1.15rem; padding: 8px 14px; }
    .tcopa-hud { padding: 6px 10px; }
}

@media (max-width: 500px) {
    #tcopa-campo { height: 320px; }
    .tcopa-palavra { font-size: 0.9rem; padding: 6px 11px; }
    .tcopa-flag { height: 17px; }
    #tcopa-input { font-size: 1.1rem; padding: 9px 12px; }
    .tcopa-hud-relogio { font-size: 1.2rem; }
    .tcopa-prog-wrap { min-width: 60px; height: 10px; }
}
