* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  color: #5a3d8a;
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.subtitle {
  color: #777;
  font-size: 0.95rem;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.score-box {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.score-box .label {
  font-size: 0.8rem;
  opacity: 0.9;
}

.score-box span:last-child {
  font-size: 1.5rem;
  font-weight: bold;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.controls button {
  background: #5a3d8a;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}

.controls button:hover {
  background: #4a2f74;
  transform: translateY(-2px);
}

.game-area {
  display: flex;
  gap: 20px;
}

.column {
  flex: 1;
}

.column h2 {
  text-align: center;
  color: #5a3d8a;
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.card:hover:not(.matched) {
  border-color: #764ba2;
  transform: scale(1.03);
}

.card.selected {
  background: #ffe082;
  border-color: #ffb300;
  transform: scale(1.03);
}

.card.matched {
  background: #a5d6a7;
  border-color: #66bb6a;
  color: #2e7d32;
  cursor: default;
  opacity: 0.85;
}

.card.wrong {
  animation: shake 0.4s;
  border-color: #e53935;
  background: #ffcdd2;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.message {
  text-align: center;
  margin-top: 20px;
  font-size: 1.1rem;
  font-weight: bold;
  min-height: 28px;
  color: #5a3d8a;
}

.win-screen {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.win-screen.hidden {
  display: none;
}

.win-card {
  background: #fff;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  animation: popIn 0.4s;
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.win-card h2 {
  color: #5a3d8a;
  font-size: 2rem;
  margin-bottom: 12px;
}

.win-card p {
  margin-bottom: 10px;
  color: #555;
}

.final-score {
  font-size: 1.3rem;
  font-weight: bold;
  color: #f5576c;
}

.win-card button {
  margin-top: 15px;
  background: #5a3d8a;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
}

@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .game-area { gap: 10px; }
  .card { padding: 10px; font-size: 1rem; }
  .score-box { min-width: 80px; padding: 10px 14px; }
}