/* Minesweeper Game specific styles */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
  background: linear-gradient(135deg, #6c757d, #495057);
  padding: 20px;
  border-radius: 12px;
  color: white;
  box-shadow: 0 8px 32px rgba(108, 117, 125, 0.3);
}

.score-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.score-box {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  min-width: 70px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.score-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.score-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-value {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.game-controls .btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.game-controls .btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.game-controls .btn:active {
  transform: translateY(0);
}

.difficulty-select {
  padding: 8px 12px;
  border: 2px solid #e1e8ed;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
}

.difficulty-select:focus {
  outline: none;
  border-color: #6c757d;
  box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.1);
}

.game-container {
  position: relative;
  margin: 0 auto;
  overflow-x: auto;
  padding: 10px;
}

.game-board {
  display: grid;
  gap: 1px;
  margin: 0 auto;
  padding: 10px;
  background: #6c757d;
  border-radius: 8px;
  border: 3px solid #6c757d;
  user-select: none;
}

.game-board.beginner {
  grid-template-columns: repeat(9, 1fr);
  max-width: 270px;
}

.game-board.intermediate {
  grid-template-columns: repeat(16, 1fr);
  max-width: 480px;
}

.game-board.expert {
  grid-template-columns: repeat(30, 1fr);
  max-width: 900px;
}

.mine-cell {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px outset #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mine-cell:hover {
  background: linear-gradient(135deg, #fff, #f8f9fa);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.mine-cell.revealed {
  background: linear-gradient(135deg, #fff, #f8f9fa);
  border: 1px solid #dee2e6;
  cursor: default;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mine-cell.revealed:hover {
  background: linear-gradient(135deg, #fff, #f8f9fa);
  transform: none;
}

.mine-cell.flagged {
  background: linear-gradient(135deg, #ffc107, #ffb300);
  color: #dc3545;
  font-weight: bold;
  animation: flagWave 0.3s ease-in-out;
}

@keyframes flagWave {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.mine-cell.flagged::before {
  content: '🚩';
  font-size: 16px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-2px); }
  60% { transform: translateY(-1px); }
}

.mine-cell.mine {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: #fff;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.mine-cell.mine::before {
  content: '💣';
  font-size: 16px;
  animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.mine-cell.mine.exploded {
  background: linear-gradient(135deg, #ff1744, #d50000);
  animation: explode 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.8);
}

@keyframes explode {
  0% { 
    transform: scale(1); 
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
  }
  50% { 
    transform: scale(1.3); 
    box-shadow: 0 0 30px rgba(255, 23, 68, 1);
  }
  100% { 
    transform: scale(1.1); 
    box-shadow: 0 0 20px rgba(255, 23, 68, 0.8);
  }
}

.mine-cell.wrong-flag {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: #fff;
  animation: wrongFlag 0.5s ease-in-out;
}

@keyframes wrongFlag {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.mine-cell.wrong-flag::before {
  content: '❌';
  font-size: 14px;
}

/* Number colors with enhanced effects */
.mine-cell.number-1 { 
  color: #007bff; 
  text-shadow: 0 1px 2px rgba(0, 123, 255, 0.3);
  font-weight: 900;
}
.mine-cell.number-2 { 
  color: #28a745; 
  text-shadow: 0 1px 2px rgba(40, 167, 69, 0.3);
  font-weight: 900;
}
.mine-cell.number-3 { 
  color: #dc3545; 
  text-shadow: 0 1px 2px rgba(220, 53, 69, 0.3);
  font-weight: 900;
}
.mine-cell.number-4 { 
  color: #6f42c1; 
  text-shadow: 0 1px 2px rgba(111, 66, 193, 0.3);
  font-weight: 900;
}
.mine-cell.number-5 { 
  color: #fd7e14; 
  text-shadow: 0 1px 2px rgba(253, 126, 20, 0.3);
  font-weight: 900;
}
.mine-cell.number-6 { 
  color: #20c997; 
  text-shadow: 0 1px 2px rgba(32, 201, 151, 0.3);
  font-weight: 900;
}
.mine-cell.number-7 { 
  color: #e83e8c; 
  text-shadow: 0 1px 2px rgba(232, 62, 140, 0.3);
  font-weight: 900;
}
.mine-cell.number-8 { 
  color: #6c757d; 
  text-shadow: 0 1px 2px rgba(108, 117, 125, 0.3);
  font-weight: 900;
}

.game-status {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #6c757d;
  margin: 20px 0;
  padding: 15px;
  background: rgba(108, 117, 125, 0.1);
  border-radius: 8px;
  border: 2px solid rgba(108, 117, 125, 0.2);
}

.game-instructions {
  margin-top: 20px;
  background: #f8f9fa;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 16px;
}

.instruction-title {
  font-weight: 600;
  color: #495057;
  margin-bottom: 12px;
  font-size: 16px;
}

.instruction-content p {
  margin: 8px 0;
  color: #6c757d;
  font-size: 14px;
  line-height: 1.5;
}

.instruction-content strong {
  color: #495057;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 20px 0;
  text-align: center;
}

.modal-header h3 {
  margin: 0;
  color: #495057;
  font-size: 20px;
}

.modal-body {
  padding: 20px;
  text-align: center;
}

.modal-body p {
  margin: 0 0 15px;
  color: #6c757d;
}

.final-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
}

.stat-item span:last-child {
  color: #6c757d;
}

.new-record {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #8b7500;
  padding: 10px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 16px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.modal-footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
  .game-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .score-container {
    justify-content: center;
  }
  
  .game-controls {
    justify-content: center;
  }
  
  .mine-cell {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  
  .game-board.beginner {
    max-width: 216px;
  }
  
  .game-board.intermediate {
    max-width: 384px;
  }
  
  .game-board.expert {
    max-width: 720px;
  }
}

@media (max-width: 480px) {
  .score-container {
    gap: 8px;
  }
  
  .score-box {
    min-width: 60px;
    padding: 8px 12px;
  }
  
  .score-label {
    font-size: 11px;
  }
  
  .score-value {
    font-size: 16px;
  }
  
  .mine-cell {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  
  .mine-cell.flagged::before,
  .mine-cell.mine::before {
    font-size: 12px;
  }
  
  .game-board.beginner {
    max-width: 180px;
  }
  
  .game-board.intermediate {
    max-width: 320px;
  }
  
  .game-board.expert {
    max-width: 600px;
  }
  
  .difficulty-select {
    font-size: 12px;
    padding: 6px 10px;
  }
}