* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  color: white;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.setup-card {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  margin: 0 auto;
}

.setup-card h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #4a5568;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #4a5568;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  background: #718096;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: #4a5568;
}

.game-info {
  display: flex;
  justify-content: space-around;
  background: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
}

.info-item {
  text-align: center;
  margin: 5px;
}

.info-item .label {
  display: block;
  font-weight: bold;
  color: #4a5568;
  font-size: 0.9rem;
}

.info-item span:last-child {
  font-size: 1.2rem;
  color: #2d3748;
  font-weight: bold;
}

.hanoi-game {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  background: white;
  padding: 40px 20px;
  border-radius: 15px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  min-height: 300px;
}

.tower {
  position: relative;
  width: 200px;
  height: 250px;
  cursor: pointer;
  transition: transform 0.2s;
}

.tower:hover {
  transform: scale(1.02);
}

.tower-base {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 20px;
  background: #8b4513;
  border-radius: 10px;
}

.tower-pole {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 200px;
  background: #654321;
  border-radius: 4px;
}

.disks-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 200px;
}

.disk {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 3px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.disk:hover {
  transform: translateX(-50%) translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.disk.selected {
  transform: translateX(-50%) translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.disk-1 {
  width: 60px;
  height: 20px;
  background: #ff6b6b;
}
.disk-2 {
  width: 80px;
  height: 20px;
  background: #4ecdc4;
}
.disk-3 {
  width: 100px;
  height: 20px;
  background: #45b7d1;
}
.disk-4 {
  width: 120px;
  height: 20px;
  background: #96ceb4;
}
.disk-5 {
  width: 140px;
  height: 20px;
  background: #feca57;
}
.disk-6 {
  width: 160px;
  height: 20px;
  background: #ff9ff3;
}

.game-controls {
  text-align: center;
  margin-bottom: 30px;
}

.game-controls button {
  margin: 0 10px;
}

.ranking-section {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ranking-section h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #4a5568;
}

.ranking-table {
  overflow-x: auto;
}

.ranking-table table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.ranking-table th {
  background: #f7fafc;
  font-weight: bold;
  color: #4a5568;
}

.ranking-table tr:hover {
  background: #f7fafc;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 15% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  color: #4a5568;
  margin-bottom: 20px;
}

.modal-buttons {
  margin-top: 25px;
}

.modal-buttons button {
  margin: 0 10px;
}

#winStats {
  background: #f7fafc;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

#winStats p {
  margin: 5px 0;
  font-size: 1.1rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  header h1 {
    font-size: 2rem;
  }

  .hanoi-game {
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    min-height: auto;
  }

  .tower {
    width: 150px;
    height: 200px;
    margin: 10px 0;
  }

  .tower-base {
    width: 140px;
  }

  .tower-pole {
    height: 150px;
  }

  .disks-container {
    height: 150px;
  }

  .disk-1 {
    width: 50px;
  }
  .disk-2 {
    width: 65px;
  }
  .disk-3 {
    width: 80px;
  }
  .disk-4 {
    width: 95px;
  }
  .disk-5 {
    width: 110px;
  }
  .disk-6 {
    width: 125px;
  }

  .game-info {
    flex-direction: column;
    gap: 10px;
  }

  .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .info-item .label {
    display: inline;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
  }

  .modal-buttons button {
    display: block;
    width: 100%;
    margin: 10px 0;
  }
}

@media (max-width: 480px) {
  .setup-card {
    padding: 20px;
    margin: 0 10px;
  }

  .ranking-table {
    font-size: 0.9rem;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 8px 4px;
  }
}
