* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top, #2a1d4d, #130a24 65%);
  color: #f8fafc;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.topnav { margin-bottom: 10px; color: #ddd6fe; }
.topnav a { color: #f5d0fe; text-decoration: none; }
.topnav a:hover { text-decoration: underline; }
h1 { margin: 6px 0 4px; }
.subtitle { margin: 0 0 12px; color: #ddd6fe; }
.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.hud > div {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.card {
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 12px;
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease;
}
.card:hover { transform: translateY(-2px); }
.card.back {
  background: linear-gradient(160deg, #4c1d95, #312e81);
  color: transparent;
}
.card.front {
  background: #ede9fe;
  color: #312e81;
}
.card.matched {
  background: #86efac;
  color: #14532d;
}
.controls { margin-top: 12px; display: grid; gap: 8px; }
button {
  background: #7c3aed;
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 1rem;
  cursor: pointer;
}
button:hover { background: #6d28d9; }
.msg { margin: 0; color: #ddd6fe; min-height: 1.2rem; }
