* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: #f5f5f5;
  color: #333;
}

.start-screen, .result-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.start-content, .result-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

h1, h2 {
  margin-bottom: 1rem;
  color: #4a4a4a;
}

.time-selection {
  margin: 1.5rem 0;
}

.time-selection input {
  padding: 0.5rem;
  width: 80px;
  border: 1px solid #ddd;
  border-radius: 5px;
  text-align: center;
  font-size: 1rem;
}

button {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  margin: 0.5rem;
  transition: all 0.3s ease;
}

button:hover {
  background: #45a049;
  transform: translateY(-2px);
}

.rules {
  margin-top: 1.5rem;
  text-align: left;
}

.rules ul {
  list-style-type: none;
  padding-left: 1rem;
}

.rules li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
}

.rules li:before {
  content: "•";
  color: #4CAF50;
  position: absolute;
  left: 0;
}

.game-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.timer, .moves {
  font-size: 1.2rem;
  font-weight: 600;
}

.wrapper {
  width: 100%;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  list-style: none;
}

.card {
  height: 120px;
  width: calc(25% - 15px);
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform 0.2s;
}

.card:active {
  transform: scale(0.95);
}

.view {
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 7px;
  background: white;
  pointer-events: none;
  backface-visibility: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s linear;
  display: flex;
  justify-content: center;
  align-items: center;
}

.front-view img {
  width: 60px;
}

.back-view img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.front-view {
  transform: rotateY(0deg);
}

.back-view {
  transform: rotateY(180deg);
}

.card.flip .front-view {
  transform: rotateY(180deg);
}

.card.flip .back-view {
  transform: rotateY(360deg);
}

.card.shake {
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-13px); }
  40% { transform: translateX(13px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
}

.stats {
  margin: 1.5rem 0;
  font-size: 1.2rem;
}

.stats p {
  margin: 0.5rem 0;
}

@media (max-width: 768px) {
  .card {
    width: calc(33.33% - 15px);
    height: 100px;
  }
}

@media (max-width: 480px) {
  .card {
    width: calc(50% - 15px);
    height: 90px;
  }
  
  .game-header {
    flex-direction: column;
    gap: 10px;
  }
}