:root {
  --cell-size: 40px;
  --accent-color: #ffaa33;
  --accent-color-alpha: #ffaa33aa;
  --primary-color: #007acc;
  --primary-color-alpha: #007accbb;
  --background-color: #1e1e2f;
  --text-color: #ddd;
  --board-bg: #25263b;
  --cell-bg: #2c2d46;
  --cell-empty-bg: #1f2130;
}

body {
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
  margin: 20px;
  background-color: var(--background-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

header, footer {
  width: 100%;
  max-width: 700px;
  text-align: center;
  margin-bottom: 1rem;
}

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

nav a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

main {
  width: 100%;
  max-width: 700px;
  padding: 0 10px;
  box-sizing: border-box;
}

.board-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 8px 0;
  box-sizing: border-box;
  overflow-x: auto;
  margin-bottom: 1rem;
}

#board {
  display: grid;
  grid-template-columns: repeat(10, var(--cell-size));
  gap: 4px;
  background-color: var(--board-bg);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 0 15px var(--primary-color-alpha);
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--cell-bg);
  border-radius: 6px;
  border: 1px solid #444966;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  color: var(--text-color);
  transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
  box-sizing: border-box;
}

.cell.empty {
  background-color: var(--cell-empty-bg);
  color: #888aaa;
}

.cell:hover {
  background-color: #003e7e;
  box-shadow: 0 0 10px var(--accent-color);
  color: #fff;
}

.cell.suggest {
  background-color: var(--accent-color) !important;
  box-shadow: 0 0 12px 3px var(--accent-color-alpha);
  color: #222 !important;
}

#log {
  background: #22293f;
  border: 1px solid #555a7a;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 1rem;
  font-size: 1rem;
  min-height: 40px;
  box-shadow: 0 2px 6px #000a20cc;
  user-select: none;
}

button {
  background-color: #cc7a00; /* arancione scuro */
  border: none;
  border-radius: 6px;
  padding: 0.4em 0.8em;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s;
  margin: 0 0.25em 0.5em 0;
  box-shadow: 0 0 5px #cc7a00aa;
}

button:hover:not(:disabled) {
  background-color: #ffaa33; /* arancione acceso */
  box-shadow: 0 0 12px #ffaa33cc;
}

button:disabled {
  background-color: #444966;
  cursor: not-allowed;
  color: #aaa;
  box-shadow: none;
}


/* Testi e link per pagine statiche */
h1, h2, h3 {
  color: var(--accent-color);
  margin-top: 1em;
}

p {
  line-height: 1.5;
  margin-bottom: 1em;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Stile per select e input numerico */
select, input[type="number"] {
  background-color: #2c2d46;
  border: 1px solid #444966;
  border-radius: 6px;
  color: #ddd;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  min-width: 140px;
  box-sizing: border-box;
  cursor: pointer;
}

select:hover, input[type="number"]:hover,
select:focus, input[type="number"]:focus {
  border-color: #ffaa33;
  box-shadow: 0 0 8px #ffaa33aa;
  color: #fff;
}

/* Label piccolo accanto a select e input */
label.small {
  font-size: 0.9rem;
  color: #bbb;
  user-select: none;
  margin-right: 0.5em;
}

/* Riadattamento controllo timeout per input piccolo */
input[type="number"] {
  width: 90px;
}

/* Correzione spaziatura nel container dei controlli */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}

