@font-face {
    font-family: "c64";
    src: url(C64_Pro_Mono-STYLE.ttf);
    }

    /*
* {
    padding: 0;
    margin: 12px;
    }
*/

body {
    margin: 0;
    background-color: rgb(182, 182, 182);
}

.main {
    margin: 0;
    background-color: rgb(182, 182, 182);
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    }

#screen {
    background-color: rgb(129, 129, 129);
    width: 800px;
    height: 600px;
    border: 10px solid transparent;
    box-shadow: 10px 10px 5px black;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    }

#sidebar {
    margin: 20px;
    background-color: rgb(86, 86, 86);
    width: 200px;
    height: 300px;
    border: 10px solid transparent;
    box-shadow: 10px 10px 5px black;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    top: 150px;
}

.text {
    font-family: c64, mono;
    color: white;
    text-shadow: 1px 1px 2px #000000;
    font-size: large;
    font-weight: lighter;
    }

.sidebarbutton {
    margin: 10px;
    /* margin-top: auto; */
    width: 100%;
}

button, input[type=text] {    
    background-color: rgb(0 136 255);
    color: white;
    text-shadow: 1px 1px black;
    border: 10px solid transparent;
    box-shadow: 3px 3px 3px black;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button {
    cursor: pointer;
}

#genderChoice {
    display: flex;
    flex-direction: row;
    align-items: center;
}

input[type="radio"] {
    border: 0 !important;
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px !important;
    overflow: hidden;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
}

#f + label, #m + label {
    display: inline-flex;
    align-items: center;
    margin-right: 30px;
}

#f + label::before, #m + label::before {
    content: '';
    display: block;
    height: 1.25em;
    width: 1.25em;
    border: solid 2px white;
    border-radius: 50%;
    margin-right: 0.5em;
    box-shadow: 2px 2px black;
}

/*
input[type="radio"]:checked + label {
  color: black;
}
*/

/* input[type="radio"]:checked + label::before {
    background-color: currentColor; 
    border-color: currentColor;
}

#peggioSelector {
    position: fixed;
    top: 10px;
    right: 10px;
}



.checkbox-wrapper-32 *,
.checkbox-wrapper-32 *::after,
.checkbox-wrapper-32 *::before {
box-sizing: border-box;
}

.checkbox-wrapper-32 input[type="checkbox"] {
display: inline-block;
vertical-align: middle;
opacity: 0;
}

.checkbox-wrapper-32 input[type="checkbox"],
.checkbox-wrapper-32 label::before {
width: var(--size);
height: var(--size);
position: absolute;
left: 0;
top: 0;
transform: translateY(-75%);
}

.checkbox-wrapper-32 label {
display: inline-block;
position: relative;
padding: 0 0 0 calc(var(--size) + 7px);
}

.checkbox-wrapper-32 label::before {
content: '';
border: var(--border-size) solid #000;
opacity: 0.7;
transition: opacity 0.3s;
}

.checkbox-wrapper-32 input[type="checkbox"]:checked + label::before {
opacity: 1;
}

.checkbox-wrapper-32 svg {
position: absolute;
top: calc(50% + var(--border-size));
left: var(--border-size);
width: calc(var(--size) - (var(--border-size) * 2));
height: calc(var(--size) - (var(--border-size) * 2));
margin-top: calc(var(--size) / -2);
pointer-events: none;
}

.checkbox-wrapper-32 svg path {
stroke-width: 0;
fill: none;
transition: stroke-dashoffset 0.2s ease-in 0s;
}

.checkbox-wrapper-32 svg path + path {
transition: stroke-dashoffset 0.2s ease-out 0.2s;
}

.checkbox-wrapper-32 input[type="checkbox"]:checked ~ svg path {
stroke-dashoffset: 0;
stroke-width: calc(var(--size) / 2);
}
 */

#checkbox-wrapper-32 {
    position: fixed;
    top: 10px;
    right: 10px;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 16px;
  color: #000;
}
  
.custom-checkbox input[type="checkbox"] {
  display: none;
}
  
.custom-checkbox .checkmark {
  width: 24px;
  height: 24px;
  border: 2px solid #000;/*border: 2px solid #333;*/
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}
  
/* Icona del libro (dizionario) disegnata in SVG: prima veniva da Font Awesome */
.custom-checkbox .checkmark::before {
  content: "";
  width: 16px;
  height: 16px;
  background-color: transparent;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 1h9a1 1 0 0 1 1 1v10H4a1 1 0 0 0 0 2h9v1H4a2 2 0 0 1-2-2V2a1 1 0 0 1 1-1z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 1h9a1 1 0 0 1 1 1v10H4a1 1 0 0 0 0 2h9v1H4a2 2 0 0 1-2-2V2a1 1 0 0 1 1-1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
  
.custom-checkbox input[type="checkbox"]:checked + .checkmark {
  background-color: rgb(0 136 255);
  border-color: #000;
}
  
.custom-checkbox input[type="checkbox"]:checked + .checkmark::before {
  background-color: #fff;
}
  
.custom-checkbox:hover {
  color: #666;
}
  
.custom-checkbox:hover .checkmark {
  transform: scale(1.05);
  cursor: help;
}

.custom-checkbox input[type="checkbox"]:focus + .checkmark {
  box-shadow: 0 0 3px 2px rgba(0, 0, 0, 0.2);
  outline: none;
}

/* ------------------------------------------------------------------
   Link per tornare alla home del sito
   ------------------------------------------------------------------ */

.torna {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 10;
    padding: 6px 4px;
    font-size: 13px;
    text-decoration: none;
    opacity: 0.85;
    }

.torna:hover, .torna:focus-visible {
    opacity: 1;
    color: rgb(0 136 255);
    }

/* ------------------------------------------------------------------
   Allineamento testi e input (valgono ovunque)
   ------------------------------------------------------------------ */

h1.text {
    text-align: center;
    }

#screen input[type=text] {
    max-width: 100%;
    box-sizing: border-box;
    }

/* ------------------------------------------------------------------
   Layout per schermi stretti (telefono, tablet in verticale)
   Lo schermo grigio occupa la larghezza disponibile e i pulsanti
   della sidebar si dispongono in riga sotto di esso.
   ------------------------------------------------------------------ */

@media (max-width: 1100px) {

    body {
        margin: 0;
        }

    .main {
        width: auto;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        box-sizing: border-box;
        flex-direction: column;
        justify-content: flex-start;
        padding: 56px 16px 24px;    /* spazio in alto per l'interruttore */
        }

    #screen {
        width: 100%;
        max-width: 800px;
        height: auto;
        min-height: 60vh;
        min-height: 60dvh;
        box-sizing: border-box;
        padding: 16px 12px;
        box-shadow: 6px 6px 4px black;
        }

    #screen h1.text {
        font-size: clamp(13px, 3.8vw, 18px);
        line-height: 1.5;
        margin: 0.3em 0;
        overflow-wrap: anywhere;
        }

    #screen {
        font-size: 9px;             /* i <br> di spaziatura si accorciano in proporzione */
        }

    #screen input[type=text] {
        width: 100%;
        font-size: 16px;            /* evita lo zoom automatico su iOS */
        margin-top: 1em;
        }

    #sidebar {
        position: static;
        width: 100%;
        max-width: 800px;
        height: auto;
        min-height: 0;
        box-sizing: border-box;
        margin: 20px 0 0;
        padding: 6px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: stretch;
        box-shadow: 6px 6px 4px black;
        }

    #sidebar:empty {
        visibility: hidden;
        }

    #sidebar br {
        display: none;
        }

    .sidebarbutton {
        flex: 1 1 140px;
        width: auto;
        margin: 6px;
        min-height: 48px;           /* bersaglio comodo per il dito */
        font-size: 15px;
        line-height: 1.4;
        }
    }

/* ------------------------------------------------------------------
   Finestra di anteprima della "stampa"
   ------------------------------------------------------------------ */

#stampa-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    box-sizing: border-box;
    }

#stampa-overlay[hidden] {
    display: none;
    }

#stampa-overlay img {
    max-width: 100%;
    max-height: 70vh;
    max-height: 70dvh;
    box-shadow: 10px 10px 5px black;
    border-radius: 2px;
    }

#stampa-overlay .stampa-nota {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    }

#stampa-overlay .stampa-pulsanti {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    }

#stampa-overlay .stampa-pulsanti button {
    min-width: 120px;
    min-height: 44px;
    }

#stampa-overlay .stampa-pulsanti button[hidden] {
    display: none;
    }
