@font-face {
    font-family: 'FonteSoulframe';
    src: url('fonts/Fonte_Soulframe.ttf') format('truetype');
}

/* Nova fonte */
@font-face {
    font-family: 'FonteRose';
    src: url('fonts/Fonte_Soulframe_2.ttf') format('truetype');
}

.novo-ativo {
    font-family: 'FonteRose';
}


/* Fundo */
body {
    background: url('background.png') no-repeat center center fixed;
    background-size: cover;
    background-color: #000; /* fallback */
    color: #d4af37;
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
}

/* Título */
#titulo {
    font-size: 2.5em;
    margin-top: 20px;
    margin-bottom: 30px;
    
    /* Cor base transparente (para o gradiente) */
    background: linear-gradient(45deg, #ffd700, #ffcc33, #fffacd, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    /* Brilho dourado */
    text-shadow: 
        0 0 5px rgba(255, 215, 0, 0.5),
        0 0 10px rgba(255, 215, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.3);

    transition: all 0.3s ease;
}

#titulo.sf-ativo {
    font-family: 'FonteSoulframe';
    letter-spacing: 3px;
}

/* Container principal */
.teclado-container {
    display: inline-block;
    padding: 20px;
    border-radius: 20px;
    background: rgba(20, 20, 20, 0.85);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* Caixa de texto */
#display {
    width: 100%;
    max-width: 600px;
    height: 100px;
    font-size: 1.2em;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #d4af37;
    background: rgba(20, 20, 20, 0.85);
    color: #fff;
    resize: none;
    animation: borderWave 3s linear infinite;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
     line-height: 1.5;
}

#display.sf-ativo {
    font-family: 'FonteSoulframe';
}

/* Linhas */
.linha-teclas {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

/* Teclas */
.tecla {
    font-size: 1.1em;
    margin: 4px;
    padding: 12px 20px;
    border-radius: 10px;
    border: 2px solid #555;
    background: rgba(20, 20, 20, 0.85);
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
}

.tecla.sf-ativo {
    font-family: 'FonteSoulframe';
}

.tecla:hover {
    background: #222;
    transform: scale(1.05);
}

/* Efeito de clique */
.tecla:active {
    transform: scale(0.95);
    filter: brightness(1.3);
}

/* =========================
   ANIMAÇÕES DE WAVE POR COR
   ========================= */

/* Wave vermelho */
@keyframes waveRed {
    0% { border-color: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; }
    50% { border-color: #ff1a1a; box-shadow: 0 0 10px #ff1a1a; }
    100% { border-color: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; }
}

/* Wave verde */
@keyframes waveGreen {
    0% { border-color: #00ffb3; box-shadow: 0 0 10px #00ffb3; }
    50% { border-color: #00cc99; box-shadow: 0 0 10px #00cc99; }
    100% { border-color: #00ffb3; box-shadow: 0 0 10px #00ffb3; }
}

/* Wave azul */
@keyframes waveBlue {
    0% { border-color: #3399ff; box-shadow: 0 0 10px #3399ff; }
    50% { border-color: #0066ff; box-shadow: 0 0 10px #0066ff; }
    100% { border-color: #3399ff; box-shadow: 0 0 10px #3399ff; }
}

/* Wave dourado para a borda do display */
@keyframes borderWave {
    0%   { border-color: rgba(212, 175, 55, 0.5); box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }
    50%  { border-color: rgba(212, 175, 55, 1);   box-shadow: 0 0 20px rgba(212, 175, 55, 0.6); }
    100% { border-color: rgba(212, 175, 55, 0.5); box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }
}


/* Aplicar animação por linha */
.linha-vermelha .tecla {
    animation: waveRed 2s linear infinite;
    animation-delay: calc((var(--i)) * 0.1s); /* da direita para a esquerda ajustado via HTML */
}

.linha-verde .tecla {
    animation: waveGreen 2s linear infinite;
    animation-delay: calc((var(--i)) * 0.1s);
}

.linha-azul .tecla {
    animation: waveBlue 2s linear infinite;
    animation-delay: calc((var(--i)) * 0.1s);
}

/* Tecla de espaço */
#espaco {
    width: 400px;
    background: rgba(20, 20, 20, 0.85);
    font-weight: bold;
}

/* =========================
   RESPONSIVIDADE AJUSTADA
   ========================= */

/* Tablets e celulares */
@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow-x: hidden;
    }

    #titulo {
        font-size: 2em;
        margin-top: 15px;
        text-shadow:
            2px 2px 0 #000,
            -2px -2px 0 #000,
            0 0 10px rgba(255, 215, 0, 0.7);
    }

    .teclado-container {
        width: 95%;
        padding: 10px;
        border-radius: 15px;
    }

    #display {
        width: 90%;
        height: 80px;
        font-size: 1em;
        padding: 8px;
        margin-bottom: 15px;
    }

    .linha-teclas {
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 8px;
    }

    .tecla {
        flex: 1 0 9%;
        min-width: 40px;
        max-width: 55px;
        padding: 10px 0;
        font-size: 0.9em;
        margin: 3px;
    }

    #espaco {
        width: 80%;
    }
}

/* Celulares pequenos (tela < 480px) */
@media (max-width: 480px) {
    #titulo {
        font-size: 1.5em;
        margin-top: 10px;
    }

    .teclado-container {
        width: 98%;
        padding: 8px;
    }

    #display {
        width: 95%;
        height: 70px;
        font-size: 0.95em;
        padding: 6px;
    }

    .tecla {
        min-width: 35px;
        max-width: 50px;
        font-size: 0.85em;
        padding: 8px 0;
        margin: 2px;
    }

    #espaco {
        width: 90%;
    }
}
