* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f6f7fb;
  margin: 0;
  padding: 16px;
  color: #1f2330;
}
.wrap { max-width: 420px; margin: 0 auto; text-align: center; }
.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}
#newbtn {
  background: #4f46e5; color: white; border: 0; padding: 8px 14px;
  border-radius: 6px; cursor: pointer; font-family: inherit;
}
#newbtn:hover { background: #4338ca; }
.meta {
  display: flex; justify-content: space-around; margin-bottom: 12px;
  font-size: 15px; font-weight: 600; color: #475569;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  aspect-ratio: 1;
  user-select: none;
  margin: 0 auto 16px;
  max-width: 320px;
}
.tile {
  aspect-ratio: 1;
  border-radius: 8px;
  background: #e2e8f0;
  border: 2px solid #cbd5e1;
  transition: background 0.1s ease;
}
.tile.lit {
  background: #4f46e5;
  border-color: #4338ca;
  box-shadow: 0 0 12px rgba(79,70,229,0.5);
}
.controls {
  display: flex; justify-content: center; margin-bottom: 12px;
}
.match-btn {
  width: 80%;
  min-height: 64px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: #10b981;
  color: white;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
  transition: background 0.1s ease, transform 0.1s ease;
}
.match-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}
.match-btn:not(:disabled):active { transform: scale(0.97); background: #059669; }
.match-btn.flash-good { background: #22c55e !important; }
.match-btn.flash-bad  { background: #ef4444 !important; }
.result {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
}
.result.win { background: #d1fae5; color: #065f46; }
.result.hidden { display: none; }
