/* =====================================================
   CruciSilver
   style.css
   Grafica versione definitiva
===================================================== */


* {
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}



body {

    margin: 0;

    min-height: 100vh;

    background:
        linear-gradient(
            135deg,
            #f5f8ff,
            #ffffff
        );

    color: #1f2937;

}




.app{

    width:100%;
    max-width:900px;

    margin:0 auto;

    padding:20px;

    overflow-x:hidden;

}





.screen {
    display: none !important;
    text-align: center;
    animation: fadeIn 0.4s ease;
}


.screen.active {
    display: block !important;

}




@keyframes fadeIn {

    from {

        opacity: 0;

        transform: translateY(10px);

    }


    to {

        opacity: 1;

        transform: translateY(0);

    }

}






/* =====================
   SCHERMATA INIZIALE
===================== */



h1 {

    font-size: 3rem;

    margin-top: 50px;

    color: #0066cc;

}



.intro {

    max-width: 600px;

    margin: 25px auto;

    font-size: 1.2rem;

    line-height: 1.6;

}




input {

    width: 90%;

    max-width: 400px;

    padding: 15px;

    border-radius: 12px;

    border: 2px solid #d1d5db;

    font-size: 1rem;

    margin: 20px;

}





button {


    background: #0066cc;

    color: white;

    border: none;

    border-radius: 14px;

    padding: 15px 30px;

    font-size: 1rem;

    cursor: pointer;

    transition: 0.2s;


}



button:hover {

    transform: scale(1.05);

}






/* =====================
   AREA GIOCO
===================== */


.gameArea {


    display: flex;

    gap: 30px;

    margin-top: 30px;

    justify-content: center;


}



#grid{

    display:grid;

    gap:3px;

    flex-shrink: 0;
}



.cell {


    width: 42px;

    height: 42px;

    background: white;

    border: 1px solid #9ca3af;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 1.3rem;

    font-weight: bold;

}




.cell.active {


    background: #ffd166;

}



.cell.correct {


    background: #90be6d;

    color: white;

}






#definitions {


    text-align: left;

    background: white;

    padding: 20px;

    border-radius: 18px;

    box-shadow:

        0 5px 20px rgba(0,0,0,0.08);


}





#definitions p {


    cursor: pointer;

    padding: 8px;

    border-radius: 8px;


}




#definitions p:hover {


    background: #eef6ff;


}





/* =====================
   CARD FINALE
===================== */


#card {


    margin: 30px auto;

    width: 350px;

    min-height: 220px;

    background:

        linear-gradient(
            135deg,
            #0066cc,
            #00a8e8
        );

    border-radius: 25px;

    color: white;

    display:flex;

    align-items:center;

    justify-content:center;

    flex-direction:column;

    font-size:1.2rem;

    padding:25px;


}






/* =====================
   CRUCISILVER CELLE GIOCO
===================== */


.cell {

    user-select: none;
    cursor: pointer;

}



.cell.hidden {

    visibility: hidden;

}



.cell.selected {

    background: #ffd166;

}



.cell.secret {

    background: #00a8e8;
    color: white;

}



.cell.filled {

    background: white;
    color: #1f2937;

}


.cell.secret.filled {

    background: #00a8e8;
    color: white;

}



.cell.correct {

    background: #90be6d;
    color: white;

}

.cell.completed {

    background: #f77f00;

    color: white;

    animation: pulseWord 0.5s ease;


}



@keyframes pulseWord {


    0% {

        transform: scale(1);

    }


    50% {

        transform: scale(1.08);

    }


    100% {

        transform: scale(1);

    }

}



.cell {

    position: relative;

}



.cell::before {


    content: attr(data-number);


    position: absolute;


    top: 2px;


    left: 3px;


    font-size: 10px;


    font-weight: bold;


    color: #333;


}





/* ===============================
   PAROLA SELEZIONATA
================================ */


.cell.word-selected {

    background: #ffe5b4;

}



.definition-selected {

    background: #fff3cd;

    border-radius: 8px;

    padding: 5px;

}




#progressMessage {

    font-size: 14px;

    margin-top: 5px;

    font-style: italic;

}


.gridContainer{

    width:100%;

    display:flex;

    justify-content:center;

    overflow-x:auto;

    overflow-y:hidden;

    -webkit-overflow-scrolling:touch;

}






/* ===============================
  VERSIONE SMARTPHONE
================================ */

@media (max-width:700px){

    .gameArea{

    display:flex;

    flex-direction:column;

    align-items:center;

    justify-content:center;

    width:100%;

    gap:20px;

}


    #definitions{

        width:95%;

    }

    h1{

        font-size:2.3rem;

    }

    .cell{

        width:35px;

        height:35px;

        font-size:1rem;

    }

}





/* ===============================
   CARD CONDIVISIONE
================================ */


.shareCard {


    width: 320px;

    min-height: 420px;

    margin: 20px auto;

    background: white;

    border-radius: 25px;

    overflow: hidden;

    box-shadow: 0 8px 25px rgba(0,0,0,0.15);

    text-align: center;


}



.cardHeader {


    background: #f77f00;

    color: white;

    font-size: 28px;

    font-weight: bold;

    padding: 25px;


}



.cardBody {


    padding: 25px;


}



.cardBody h3 {


    color: #0077b6;

    font-size: 26px;


}



.hiddenWord {

    margin: 25px auto;

    padding: 18px;

    background: #0077b6;

    color: white;

    border-radius: 15px;

    font-size: 30px;

    font-weight: bold;

    letter-spacing: 5px;

}


.shareCard h2 {

    color: #f77f00;

    font-size: 32px;

    margin: 10px 0 20px;

}





.thanks {


    margin-top: 30px;

    font-style: italic;


}



#hiddenInput{

    position:fixed;

    left:-9999px;

    top:0;

    width:1px;

    height:1px;

    opacity:0;

    pointer-events:none;

}