/* Regole di stile del sito */
body {
  font-family: "Arial", sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f5f5f5;
  color: #333;
}

h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 30px;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 5px;
  background-color: #34495e;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.cell:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.cell.selected {
  border: 3px solid #f1c40f;
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.7);
  transform: scale(1.05);
}

/* Vector color classes */
.vector-i {
  background-color: #3498db;
  color: white;
}

.vector-neg-i {
  background-color: #2980b9;
  color: white;
}

.vector-j {
  background-color: #2ecc71;
  color: white;
}

.vector-neg-j {
  background-color: #27ae60;
  color: white;
}

.vector-k {
  background-color: #e74c3c;
  color: white;
}

.vector-neg-k {
  background-color: #c0392b;
  color: white;
}

.vector-zero {
  background-color: #95a5a6;
  color: white;
}

/* Blinking animation for tris cells */
@keyframes blink {
  0% {
    transform: scale(1);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.8);
    border-color: #f1c40f;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  }
}

.tris-cell {
  animation: blink 1s infinite;
  border: 3px solid #f1c40f;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.card-selection {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.card {
  padding: 12px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 28px;
  font-weight: bold;
  transition: all 0.3s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card.selected {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card.used {
  background-color: #95a5a6;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.message {
  background-color: #2ecc71;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  text-align: center;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  font-size: 18px;
}

.player-info {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.info-box {
  background-color: #9b59b6;
  color: white;
  padding: 12px 15px;
  border-radius: 5px;
  font-weight: bold;
  min-width: 150px;
  text-align: center;
  font-size: 18px;
}

.restart-btn {
  padding: 12px 24px;
  background-color: #e67e22;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s;
}

.restart-btn:hover {
  background-color: #d35400;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.vectors-display {
  background-color: #1abc9c;
  color: white;
  padding: 12px;
  border-radius: 5px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  font-weight: bold;
  font-size: 20px;
}

.rules-section {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  background-color: #ecf0f1;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rules-section h2 {
  color: #2c3e50;
  text-align: center;
  margin-top: 0;
  font-size: 24px;
}

.rules-section h3 {
  color: #2c3e50;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 20px;
}

.rules-section p {
  margin-bottom: 10px;
  line-height: 1.5;
  font-size: 16px;
}

.vector-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px auto;
  font-size: 20px;
  max-width: 400px;
}

.vector-table th,
.vector-table td {
  border: 1px solid #bdc3c7;
  padding: 10px;
  text-align: center;
}

.vector-table th {
  background-color: #34495e;
  color: white;
  font-weight: bold;
}

.vector-table tr:nth-child(even) {
  background-color: #f8f9f9;
}

.vector-table tr:hover {
  background-color: #e8f4fc;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #bdc3c7;
}

.example-box {
  background-color: #f8f9fa;
  border-left: 4px solid #3498db;
  padding: 10px 15px;
  margin: 15px 0;
  border-radius: 0 5px 5px 0;
}

.example-title {
  font-weight: bold;
  margin-bottom: 5px;
  color: #2c3e50;
}

.math-formula {
  font-family: "Courier New", monospace;
  background-color: #e8f4fc;
  padding: 5px 10px;
  border-radius: 4px;
  display: inline-block;
  margin: 5px 0;
}

.table-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.acknowledgment {
  width: 100%;
  margin-top: 30px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
  font-style: italic;
  color: #7f8c8d;
  font-size: 16px;
  border-top: 2px solid #e0e0e0;
}
