:root{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body{
  margin:0;
  padding:20px;
  background:#0b1224;
  color:#f5f5f5;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:20px;
}

h1{
  font-size:1.8rem;
  margin:0;
  text-align:center;
}

h2{
  font-size:1.1rem;
  margin:10px 0 4px;
}

.panel{
  background:#11172f;
  border-radius:12px;
  padding:16px 20px;
  max-width:900px;
  width:100%;
  box-shadow:0 8px 20px rgba(0,0,0,.4);
}

.help-text{
  font-size:.85rem;
  opacity:.8;
  margin:0 0 8px;
}

label{
  font-size:.9rem;
  opacity:.85;
}

textarea{
  width:100%;
  min-height:60px;
  margin-top:6px;
  border-radius:8px;
  border:none;
  padding:8px 10px;
  font-size:1rem;
  resize:vertical;
}

input[type="text"]{
  border-radius:999px;
  border:none;
  padding:8px 14px;
  font-size:.95rem;
  flex:1;
  min-width:0;
}

button{
  border:none;
  border-radius:999px;
  padding:8px 18px;
  font-size:.95rem;
  cursor:pointer;
  margin-top:10px;
  margin-right:8px;
}

.btn-primary{
  background:#f89a2d;
  color:#11172f;
  font-weight:600;
}

.btn-secondary{
  background:#333a5c;
  color:#f5f5f5;
}

hr{
  border:none;
  border-top:1px solid rgba(255,255,255,.1);
  margin:14px 0;
}

/* per nascondere il wrapper della frase */
.hiddenSection{
  display:none !important;
}

/* --- LAVAGNETTA 4 RIGHE (12-14-14-12) --- */

#board{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:center;
}

.board-row{
  display:flex;
  gap:6px;
}

/* Casella base */
.tile{
  width:40px;
  height:50px;
  border-radius:4px;
  border:2px solid #2b355f;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.4rem;
  font-weight:700;
  text-transform:uppercase;
  background:#050816;
  box-shadow:0 2px 4px rgba(0,0,0,.5) inset;
  transition:background .15s, border-color .15s, box-shadow .15s, color .15s;
}

/* blocco arancione */
.tile.block{
  background:#d86a1f;
  border-color:#d86a1f;
  box-shadow:none;
  color:transparent;
}

/* lettera nascosta */
.tile.hidden{
  color:transparent;
}

/* slot vuoti avanzati */
.tile.empty{
  background:transparent;
  border-color:transparent;
  box-shadow:none;
  color:transparent;
}

/* --- CATEGORIA --- */

/* --- CATEGORIA --- */

#categoryWrapper{
  margin-top:14px;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}

#categoryWrapper label{
  font-size:.9rem;
  opacity:.85;
  align-self:center;
}

#categoryInputRow{
  display:flex;
  gap:8px;
  width:100%;
  max-width:350px;
}

#categoryInput{
  flex:1;
}

#categoryBar{
  min-height:38px;
  padding:8px 20px;
  border-radius:999px;
  background:#f5f5f5;
  color:#11172f;
  font-weight:600;
  font-size:1.1rem;
  text-transform:uppercase;
  letter-spacing:.5px;
  display:none;           /* nascosta finché non c’è una categoria */
  justify-content:center;
  align-items:center;
}
.hiddenSection{ display:none !important; }


/* --- TASTIERA --- */

#keyboard{
  margin-top:15px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  justify-content:center;
}

.key{
  min-width:32px;
  padding:6px 10px;
  border-radius:999px;
  border:none;
  background:#f5f5f5;
  color:#11172f;
  font-weight:600;
  cursor:pointer;
  text-transform:uppercase;
}

.key.used{
  background:#555d82;
  color:#b9bed6;
  cursor:default;
}

.status{
  margin-top:8px;
  font-size:.9rem;
  opacity:.85;
  text-align:center;
}

@media (max-width:600px){
  body{
    padding:12px;
  }
  .tile{
    width:32px;
    height:44px;
    font-size:1.1rem;
  }
}
