*{
  margin: 0;
  padding: 0;
}

body {
  background-color: #f1f2f3;
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1640px;
  min-width: 1240px;
  margin: 25px auto;
  color: #333;
}

.container * {
  box-sizing: border-box;
}

header {
  position: relative;
  margin-bottom: 20px;
  text-align: center;
}

header h1 {
  font-size: 32px;
  margin-bottom: 5px;
}

header p {
  font-size: 16px;
  line-height: 1.6;
}

.game-intro {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin: 0 auto 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.game-intro h2 {
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.intro-content {
  display: flex;
  gap: 30px;
}

.instructions,
.features {
  flex: 1;
}

.instructions h3,
.features h3 {
  color: #2c3e50;
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.instructions ul,
.features ul {
  padding-left: 20px;
}

.instructions li,
.features li {
  margin-top: 10px;
  line-height: 1.5;
}

.game-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.stats {
  display: flex;
  gap: 25px;
  font-size: 1.1rem;
  background: white;
  padding: 12px 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-value {
  font-weight: bold;
  color: #3498db;
}

.difficulty-selector {
  display: flex;
  gap: 15px;
}

.difficulty-btn {
  padding: 12px 25px;
  background: #ecf0f1;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #bbb;
  font-weight: 500;
}

.difficulty-btn:hover {
  background: #d5dbdb;
}

.difficulty-btn.active {
  background: #3498db;
  border-color: #3498db;
  color: white;
}

.restart-btn {
  padding: 12px 30px;
  background: #2ecc71;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.restart-btn:hover {
  background: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.game-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  width: 100%;
  margin: 0 auto 25px;
}

.card {
  aspect-ratio: 1;
  border-radius: 12px;
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 1000px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  position: relative;
  transition: transform 0.3s ease;
}

.card:hover:not(.flipped):not(.matched) {
  transform: translateY(-1px);
}

.card .front,
.card .back {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.card .front {
  background: #2c3e50;
  color: white;
  font-size: 5rem;
  transform: rotateY(180deg);
}

.card .back {
  background: linear-gradient(135deg, #3498db, #2c3e50);
  color: rgba(255, 255, 255, 0.7);
  font-size: 4rem;
  transform: rotateY(0deg);
}

.card.flipped .back {
  transform: rotateY(180deg);
}

.card.flipped .front {
  transform: rotateY(0deg);
}

.card.matched .front {
  background: #2ecc71;
  animation: matchedPulse 0.6s ease;
}

@keyframes matchedPulse {
  0% {
    transform: scale(1) rotateY(0deg);
  }

  50% {
    transform: scale(1.1) rotateY(0deg);
  }

  100% {
    transform: scale(1) rotateY(0deg);
  }
}

.card.mismatched {
  animation: mismatchShake 0.5s ease;
}

@keyframes mismatchShake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.notice {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.95);
  color: white;
  padding: 18px 35px;
  border-radius: 10px;
  font-size: 1.2rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.notice.show {
  opacity: 1;
}

footer {
  margin-top: auto;
  text-align: center;
  color: #7f8c8d;
}

.features-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.feature-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}


.feature-card h3 {
  font-size: 1.4rem;
  color: #2c3e50;
  margin-bottom: 15px;
}

.feature-card p {
  color: #7f8c8d;
  line-height: 1.6;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: block;
}
