/* ============================================================================
 * FOLHA DE ESTILOS PRINCIPAL
 * Projeto: Desafio de Palavras
 * ============================================================================ */

/*--------------------------------------------------------------------------*/
/* ESTILOS GERAIS E DE BASE
/*--------------------------------------------------------------------------*/
html {
    overflow-y: scroll;
}

body {
    font-family: 'Montserrat', 'Trebuchet MS', sans-serif;
    color: #ffffff;
    line-height: 1.6;
    margin: 0;
    
    background-image: 
        linear-gradient(rgba(15, 15, 25, 0.50), rgba(15, 15, 25, 0.50)),
        url('/imagens/fundo.webp'); 
    background-size: cover;
    background-position: center 20%;
    background-attachment: fixed;
    
    display: flex;
    flex-direction: column; 
    align-items: center;
    padding: 20px;
    min-height: 100vh;
}

/*--------------------------------------------------------------------------*/
/* LAYOUT PRINCIPAL E CABEÇALHO
/*--------------------------------------------------------------------------*/
header {
    max-width: 800px;
    width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.15); 
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

main {
    background-color: rgba(10, 10, 25, 0.75);
    max-width: 800px;
    width: 100%;
    padding: 30px 40px 100px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 100px;
    margin-bottom: 100px;
}

/*--------------------------------------------------------------------------*/
/* ESTILOS DE TEXTO E LOGO
/*--------------------------------------------------------------------------*/

header h1 {
    display: inline-block;
    font-family: 'Trebuchet MS', 'Montserrat', sans-serif;
    font-size: 5em;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 3px 3px 10px rgba(0,0,0,0.8);
    margin: 20px 0 0 0;
    padding: 0;
    line-height: 1;
    text-align: left;
}

header h1 .titulo-vermelho {
    color: #ec0404;
    font-family: inherit;
}

.slogan-container {
    display: flex;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 20px;
}

.slogan-container i {
    font-size: 1.1em;
    color: #1b1b1a;
    margin-right: 5px;
    vertical-align: middle;
}

.slogan-container .slogan {
    font-family: 'Trebuchet MS', 'Montserrat', sans-serif;
    font-size: 0.70em;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
    font-style: italic;
    quotes: """ """ "'" "'";
}

.slogan-container .slogan::before {
    content: open-quote;
    font-family: Arial, sans-serif;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    vertical-align: sub;
    margin-right: 5px;
}

.slogan-container .slogan::after {
    content: close-quote;
    font-family: Arial, sans-serif;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    vertical-align: sub;
    margin-left: 5px;
}

#selecao-jogo h2 {
    font-weight: normal;
    font-size: 1.2em;
    text-align: left;
    padding-left: 10px;
    margin-bottom: 20px;
    color: #ccc;
}

/*--------------------------------------------------------------------------*/
/* ÁREA DE JOGO E CONTROLOS
/*--------------------------------------------------------------------------*/
.escondido {
    display: none !important;
}

#botoes-jogos {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 20px;
}

#botoes-jogos button {
    padding: 15px;
    font-size: 13px;
    font-weight: normal;
    color: #ffffff;
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    white-space: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    text-transform: none;
}

#botoes-jogos button:hover {
    background-color: #ff0000;
    border-color: #ff0000;
}

#display-texto {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px;
    margin-top: 15px;
    border-radius: 6px;
    min-height: 150px;
    font-family: "Courier New", Courier, monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #f1f1f1;
}

#botao-voltar {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    color: white;
    background-color: #6c757d;
}

#botao-voltar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

#area-feedback {
    margin-top: 20px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#mensagem-feedback {
    text-align: center;
    font-weight: bold;
    min-height: 24px;
    font-size: 1.1em;
    margin: 0;
}

/* ============================================================================
 * BARRA DE INPUT FIXA NO FUNDO (OTIMIZADA)
 * ============================================================================ */

#barra-input-fixa {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(15, 15, 25, 0.97) 0%, rgba(10, 10, 20, 0.98) 100%);
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 15px 20px;
    backdrop-filter: blur(10px);
}

.barra-conteudo {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.barra-input-grupo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.barra-input-grupo label {
    font-size: 14px;
    color: #ccc;
    white-space: nowrap;
    font-weight: 500;
}

#barra-input-posicao {
    flex-shrink: 0;
}

.barra-palavra-grupo {
    flex-shrink: 0;
    width: 350px;
}

#barra-posicao {
    width: 55px;
    padding: 12px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background-color: rgba(50, 50, 60, 0.8);
    color: #fff;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

#barra-palavra {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background-color: rgba(50, 50, 60, 0.8);
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

#barra-posicao:focus,
#barra-palavra:focus {
    outline: none;
    border-color: #ff0000;
    background-color: rgba(60, 60, 70, 0.9);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

#barra-botao-enviar {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    color: white;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    flex-shrink: 0;
}

#barra-botao-enviar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
    background: linear-gradient(135deg, #ff2222 0%, #dd0000 100%);
}

#barra-botao-enviar:active {
    transform: translateY(0);
}

#barra-botao-enviar i {
    font-size: 14px;
}

/* Botão de Toggle de Som */
.botao-som {
    padding: 12px 15px;
    border: none;
    border-radius: 6px;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 50px;
}

.botao-som:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.botao-som:active {
    transform: translateY(0);
}

.botao-som.desativado {
    background: rgba(150, 150, 150, 0.3);
    color: rgba(255, 255, 255, 0.5);
}

.botao-som.desativado:hover {
    background: rgba(150, 150, 150, 0.4);
}

/* ============================================================================
 * TOAST NOTIFICATION (FEEDBACK VISUAL)
 * ============================================================================ */

#toast-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px 35px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 90%;
    min-width: 300px;
}

#toast-notification.toast-visivel {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

#toast-notification.toast-escondido {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    pointer-events: none;
}

.toast-conteudo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toast-icone {
    font-size: 40px;
    flex-shrink: 0;
    animation: toastBounce 0.6s ease-out;
}

.toast-mensagem {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.4;
    text-align: left;
}

@keyframes toastBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ============================================================================
 * TOAST SORTEIO (SEPARADO)
 * ============================================================================ */

.toast-sorteio {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 16px 35px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 80%;
    width: 500px;
    color: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
    white-space: pre-line;
}

.toast-sorteio.toast-visivel {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast-sorteio.toast-escondido {
    opacity: 0;
    transform: translateX(-50%) translateY(100px);
    pointer-events: none;
}

.sorteio-frase-azul {
    color: #4a9eff;
}

#aviso-password-container {
    background: #ff4444 !important;
    color: white !important;
    padding: 15px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3) !important;
}

#aviso-password-container p {
    color: white !important;
}

/* ============================================ */
/* ÍCONES SOCIAIS E MÚSICA                     */
/* ============================================ */

.icones-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin: 25px auto;
    padding: 15px 0;
    flex-wrap: wrap;
}

/* Reduzir margem superior para a fila de música */
.icones-musica {
    margin-top: 10px;
}

.icone-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    font-size: 26px;
    color: white;
}

.icone-link:hover {
    transform: scale(1.2) translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.icone-link:active {
    transform: scale(1.1);
}

/* Cores específicas de cada plataforma */
.icone-link.spotify {
    background: #1DB954;
}

.icone-link.spotify:hover {
    box-shadow: 0 8px 25px rgba(29, 185, 84, 0.7);
}

.icone-link.youtube {
    background: #FF0000;
} 

.icone-link.youtube:hover {
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.7);
}

.icone-link.facebook {
    background: #1877F2;
}

.icone-link.facebook:hover {
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.7);
}

.icone-link.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.icone-link.instagram:hover {
    box-shadow: 0 8px 25px rgba(225, 48, 108, 0.7);
}

.icone-link.telegram {
    background: #0088cc;
}

.icone-link.telegram:hover {
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.7);
}

.icone-link.whatsapp {
    background: #25D366;
}

.icone-link.whatsapp:hover {
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.7);
}

.icone-link.tiktok {
    background: linear-gradient(45deg, #ff0050, #00f2ea);
}

.icone-link.tiktok:hover {
    box-shadow: 0 8px 25px rgba(255, 0, 80, 0.7);
}

/* ============================================ */
/* LINKS LEGAIS - DENTRO DA SECÇÃO DE JOGOS   */
/* ============================================ */

.links-legais {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px auto 20px;
    padding: 12px 15px;
    background: rgba(128, 128, 128, 0.15);
    border-radius: 8px;
}

.links-legais a {
    color: white;
    text-decoration: none;
    font-size: 0.7rem;
    padding: 4px 6px;
    transition: color 0.3s ease;
}

.links-legais a:hover {
    color: #FFD700;
}

.separador-legal {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
}

/* ============================================ */
/* FOOTER - APENAS FRASE                       */
/* ============================================ */

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin: 0 0 8px 0;
    font-style: italic;
    line-height: 1.4;
}

footer .versao {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    margin: 0;
    font-style: normal;
}

/* ============================================================================
 * REGRAS PARA ECRÃS PEQUENOS (DESIGN RESPONSIVO)
 * ============================================================================ */

/* Tablets */
@media (max-width: 768px) {
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 3.5em; 
        text-align: center;
        display: block;
    }
    
    header h1 .slogan {
        text-align: center;
    }

    #selecao-jogo h2 {
        text-align: center;
        padding-left: 0;
    }

    #botoes-jogos {
        grid-template-columns: repeat(2, 1fr);
    }
    
    main {
        padding: 20px 15px; 
    }
    
    #barra-input-fixa {
        padding: 12px 15px;
    }
    
    .barra-conteudo {
        gap: 10px;
    }
    
    .barra-palavra-grupo {
        width: 280px;
    }
    
    #barra-posicao {
        width: 50px;
        padding: 10px 8px;
        font-size: 15px;
    }
    
    #barra-palavra {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    #barra-botao-enviar {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .barra-input-grupo label {
        font-size: 13px;
    }
    
    .toast-sorteio {
        max-width: 85%;
        width: auto;
        padding: 14px 30px;
        font-size: 15px;
        bottom: 90px;
    }
    
    .icones-social {
        gap: 16px;
    }
    
    .icone-link {
        width: 52px;
        height: 52px;
        font-size: 24px;
    }
}

/* Telemóveis */
@media (max-width: 600px) {
    .icones-social {
        gap: 8px;
        padding: 12px 5px;
        margin: 20px auto;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .icone-link {
        width: 42px;
        height: 42px;
        font-size: 20px;
        flex-shrink: 0;
    }
    
    .links-legais {
        padding: 12px 15px;
        gap: 8px;
    }
    
    .links-legais a {
        font-size: 0.65rem;
        padding: 4px 6px;
    }
    
    .separador-legal {
        font-size: 0.6rem;
    }
    
    footer p {
        font-size: 0.75rem;
        padding: 0 10px;
    }
    
    footer .versao {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    #barra-input-fixa {
        padding: 10px 8px;
    }
    
    .barra-conteudo {
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    #barra-input-posicao {
        flex-shrink: 0;
    }
    
    .barra-palavra-grupo {
        flex: 1;
        min-width: 0;
    }
    
    #barra-posicao {
        width: 45px;
        padding: 10px 6px;
        font-size: 16px;
    }
    
    #barra-palavra {
        width: 100%;
        padding: 10px 12px;
        font-size: 16px;
    }
    
    #barra-botao-enviar {
        padding: 10px 12px;
        font-size: 14px;
        flex-shrink: 0;
        width: auto;
    }
    
    .botao-som {
        padding: 10px 12px;
        font-size: 16px;
        min-width: 45px;
    }
    
    .barra-input-grupo label {
        font-size: 12px;
    }
    
    #toast-notification {
        min-width: 0;
        max-width: 85%;
        padding: 20px 25px;
    }
    
    .toast-conteudo {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .toast-icone {
        font-size: 45px;
    }
    
    .toast-mensagem {
        font-size: 15px;
        text-align: center;
        line-height: 1.5;
    }
    
    .toast-sorteio {
        max-width: 90%;
        width: auto;
        padding: 12px 20px;
        font-size: 14px;
        bottom: 80px;
    }
}

/* Telemóveis muito pequenos (iPhone SE, etc) */
@media (max-width: 380px) {
    .icones-social {
        gap: 6px;
        padding: 12px 3px;
    }
    
    .icone-link {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .links-legais a {
        font-size: 0.6rem;
    }
    
    footer p {
        font-size: 0.7rem;
    }
    
    footer .versao {
        font-size: 0.6rem;
    }
}