/* Importar fontes */
/* As variáveis de cores são importadas do g_styles.css */

/* Estilos base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}


.confetti-container{
    display: none;
}

/* Container do jogo */
.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    /* background-color: var(--neutral-200); */
    position: relative;
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-in-out;
    user-select: none;
    /* align-items: center; */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Header do jogo */
.game-header {
    padding: 15px 20px;
    /* background-color: var(--neutral-100); */
    /* border-radius: 16px; */
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); */
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.5s ease-out;
    width: 100%;
    align-self: center;
    max-width: 800px;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.game-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: 6px;
}

.game-subtitle {
    font-size: 14px;
    color: var(--neutral-700);
}

.lives-container {
    display: flex;
    align-items: center;
    background: var(--neutral-200);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lives-count {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Área principal do jogo */
.main-game-area {
    display: flex;
    flex: 1;
    overflow-y: auto;
    border-radius: 16px;
    background-color: var(--neutral-100);
    padding: 20px;
    margin-bottom: 15px;
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    justify-content: center;
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Contêiner da flor */
.flower-container {
    /* width: 30%; */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 150px;
}

.flower-svg {
    width: 100%;
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: all 0.3s ease;
}

/* Animações para as pétalas */
#petala1,
#petala2,
#petala3,
#petala4,
#petala5 {
    transform-origin: center;
    transform-box: fill-box;
    transition: all 0.5s ease-in-out;
}

/* Efeito quando a pétala está murcha */
.petal-withered {
    opacity: 0.5;
    fill: #ac7c5c;
    transform: scale(0.9) rotate(-10deg);
}

/* Efeito quando a flor perde todas as pétalas */
.flower-dead #caule {
    fill: #a7a7a7;
    transform: scaleY(0.95) rotate(-5deg);
}

/* Contêiner da palavra */
.word-container {
    /* width: 70%; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.word-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    min-height: 60px;
}

/* Estilos para letras da palavra */
.container_letra {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 0 4px 8px;
    position: relative;
}

.letra_palavra {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary);
    height: 45px;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    animation: letterAppear 0.3s ease-out;
}

@keyframes letterAppear {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.container_letra[encontrada="false"] .letra_palavra {
    visibility: hidden;
}

.container_letra::after {
    content: '';
    width: 30px;
    height: 3px;
    background-color: var(--neutral-600);
    display: block;
    border-radius: 2px;
    margin-top: 5px;
}

.container_letra[encontrada="true"]::after {
    background-color: var(--primary);
    animation: lineHighlight 0.3s ease-out;
}

@keyframes lineHighlight {
    0% {
        transform: scaleX(0.5);
        background-color: var(--neutral-600);
    }

    50% {
        transform: scaleX(1.2);
        background-color: var(--primary);
    }

    100% {
        transform: scaleX(1);
        background-color: var(--primary);
    }
}

.container_espaco {
    width: 20px;
    height: 45px;
}

/* Contêiner de dica */
.hint-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.hint-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: var(--accent-2);
    color: var(--secondary);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.hint-button:hover {
    background-color: var(--secondary-light);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.hint-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hint-text {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: var(--neutral-300);
    border-radius: 8px;
    color: var(--neutral-800);
    font-size: 14px;
    max-width: 100%;
    text-align: center;
    display: none;
    animation: hintAppear 0.3s ease-out;
}

@keyframes hintAppear {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hint-visible {
    display: block;
}

/* Contêiner de mensagem */
.message-container {
    padding: 10px 15px;
    /* margin-bottom: 15px; */
    border-radius: 8px;
    text-align: center;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.message-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--neutral-700);
    display: none;
    animation: messageAppear 0.3s ease-out;
}

@keyframes messageAppear {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.message-text[cor] {
    display: block;
}

.message-text[cor="verde"] {
    color: var(--feedback-positivo);
    background-color: rgba(93, 213, 97, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    border-left: 3px solid var(--feedback-positivo);
}

.message-text[cor="vermelho"] {
    color: var(--feedback-negativo);
    background-color: rgba(255, 107, 107, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    border-left: 3px solid var(--feedback-negativo);
}

/* Teclado */
.keyboard-container {
    background-color: var(--neutral-200);
    padding: 5px 15px 55px 15px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
    animation: fadeInUp 0.7s ease-out;
    max-width: 800px;
    width: 100%;
    align-self: center;
    /* margin: 0 auto; */

    @media screen and (max-width: 768px) {
        padding: 16px 5px;
    }
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;

    @media screen and (max-width: 768px) {
        padding: 0px;
        transform: translateY(-20px);
    }
}

.keyboard-row:last-child {
    margin-bottom: 0;
}

.keyboard-key {
    min-width: unset;
    height: 40px;
    margin: 0 4px;
    border-radius: 8px;
    padding: 0;
    border: none;
    background-color: var(--neutral-100);
    color: var(--neutral-800);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 0 var(--neutral-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 0 0;
    align-self: stretch;

    @media screen and (max-width: 768px) {
        /* min-width: 30px; */
        height: 35px;
        margin: 0 2px;
        font-size: 16px;
        border-radius: 4px;
    }
}

.keyboard-key:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--neutral-400);
    background-color: var(--neutral-200);
}

.keyboard-key:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 var(--neutral-400);
}

/* Estados das teclas */
.keyboard-key[cor="verde"] {
    background-color: var(--feedback-positivo);
    color: white;
    box-shadow: 0 3px 0 var(--feedback-positivo-dark);
    pointer-events: none;
}

.keyboard-key[cor="vermelho"] {
    background-color: var(--feedback-negativo);
    color: white;
    box-shadow: 0 3px 0 var(--feedback-negativo-dark);
    pointer-events: none;
}

/* Botões de ação */
.action-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.btn-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--neutral-200);
    color: var(--neutral-800);
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 0 var(--neutral-300);
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--neutral-300);
    background-color: var(--neutral-400);
    color: var(--neutral-100);
}

.btn-reset:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 var(--neutral-500);
}

/* Feedback - usa sistema global padronizado */

/* Partículas para animações */
.particle-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
}

.particle {
    position: absolute;
    background-color: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFall 1.5s ease-in forwards;
}

@keyframes particleFall {
    0% {
        transform: translateY(0);
        opacity: 0.8;
    }

    100% {
        transform: translateY(90px);
        opacity: 0;
    }
}

/* Botão de ajuda para dispositivos móveis */
.mobile-help-button {
    display: none;
    /* position: fixed; */
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 900;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;


}

.mobile-help-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltip */
.tooltip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(43, 217, 226, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-size: 16px;
    max-width: 80%;
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
}

/* Media queries para responsividade */
@media only screen and (max-width: 768px) {
    .game-container {
        padding: 0px;
        height: auto;
        min-height: calc(100vh - 80px);
    }

    .game-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px;
        margin-bottom: 10px;
    }

    .lives-container {
        margin-top: 10px;
        align-self: flex-end;
    }

    .game-title {
        font-size: 20px;
    }

    .game-subtitle {
        font-size: 12px;
    }

    .main-game-area {
        flex-direction: column;
        padding: 15px;
        margin-bottom: 10px;
    }

    .flower-container,
    .word-container {
        width: 100%;
    }

    .flower-container {
        margin-bottom: 15px;
    }

    .flower-svg {
        max-width: 120px;
    }

    .word-display {
        margin-bottom: 10px;
    }

    .letra_palavra {
        font-size: 24px;
        height: 35px;
    }

    .container_letra {
        margin: 0 3px 6px;
    }

    .container_letra::after {
        width: 25px;
    }





    .mobile-help-button {
        display: flex;
        align-self: end;
        margin:8px;
    }

    .tooltip {
        font-size: 14px;
        max-width: 90%;
        padding: 8px 15px;
    }

    .message-text {
        font-size: 14px;
    }

    .hint-button {
        font-size: 12px;
        padding: 6px 12px;
    }

    .hint-text {
        font-size: 12px;
        padding: 6px 10px;
    }

    .btn-reset {
        font-size: 14px;
        padding: 8px 16px;
    }

    .feedback-container {
        /* first div */
        div:first-child {
            flex-direction: column;
        }
    }
}

/* Animações específicas para a flor */
@keyframes petalWither {
    0% {
        opacity: 1;
        transform: scale(1);
        fill: var(--primary);
    }

    100% {
        opacity: 0.5;
        transform: scale(0.9) rotate(-10deg);
        fill: #a7a7a7;
    }
}

@keyframes petalFall {
    0% {
        opacity: 0.5;
        transform: scale(0.9) rotate(-10deg);
    }

    100% {
        opacity: 0;
        transform: translateY(100px) rotate(-45deg) scale(0.5);
    }
}

@keyframes stemWither {
    0% {
        transform: scaleY(1);
        fill: #8C8C8C;
    }

    100% {
        transform: scaleY(0.95) rotate(-5deg);
        fill: #a7a7a7;
    }
}

@keyframes flowerCelebrate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.celebrating .flower-svg {
    animation: flowerCelebrate 0.8s ease infinite;
}

/* Para dispositivos muito pequenos */
@media only screen and (max-width: 320px) {


    .letra_palavra {
        font-size: 20px;
    }

    .container_letra::after {
        width: 20px;
    }
}

/* Adicionando classes para animações de letras */
.letter-reveal {
    animation: letterReveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--primary) !important;
}

.letter-reveal-error {
    animation: letterRevealError 0.4s ease-out;
    color: var(--feedback-negativo) !important;
}

@keyframes letterReveal {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes letterRevealError {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

/* Efeito de pressionar tecla */
.key-pressed {
    transform: translateY(3px) !important;
    box-shadow: 0 0 0 var(--neutral-400) !important;
}

.key-hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--neutral-400);
    background-color: var(--neutral-200);
}